This Rmarkdown file shows the code we used to analyze demographic change over time in and outside of historic districts.

knitr::opts_chunk$set(echo = TRUE, message=F, warning=F, fig.width = 11.5, fig.height = 6.5)
library(readr)
library(sf)
## Linking to GEOS 3.13.1, GDAL 3.11.0, PROJ 9.6.0; sf_use_s2() is TRUE
library(leaflet)
library(rstudioapi)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(patchwork)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(did)

Set working directory to the place this script is saved:

# Getting the path of your current open file
current_path = rstudioapi::getActiveDocumentContext()$path 
setwd(dirname(current_path))

Load and clean data

Load our data. We’ll first do the analysis using Census tracts, and then later use Census blocks.

# load data that has the dates the historic districts were designated
# comes from here: https://planning.dc.gov/page/dc-historic-districts
# hd_data <- readr::read_csv("https://docs.google.com/spreadsheets/d/1Ajl1iAS0NRB7vk_UFDveeWzGkwf3tuiDo-zV9_wtzRM/gviz/tq?tqx=out:csv&sheet=data")
hd_data <- readr::read_csv("hd_data/data.csv")

# load the historic district boundary shape files
# comes from here: https://opendata.dc.gov/datasets/DCGIS::historic-districts/about 
hd_shp <- sf::st_read("Historic_Districts/Historic_Districts.shp")
## Reading layer `Historic_Districts' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\Historic_Districts\Historic_Districts.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 73 features and 18 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -8584936 ymin: 4696608 xmax: -8564736 ymax: 4720410
## Projected CRS: WGS 84 / Pseudo-Mercator
# load the 2022 ward shape files
# comes from here: https://opendata.dc.gov/datasets/DCGIS::wards-from-2022/about
ward_shp <- sf::st_read("Wards_from_2022/Wards_from_2022.shp")
## Reading layer `Wards_from_2022' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\Wards_from_2022\Wards_from_2022.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 8 features and 20 fields
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: -8584936 ymin: 4691870 xmax: -8561487 ymax: 4721094
## Projected CRS: WGS 84 / Pseudo-Mercator
# load the zoning map:
# comes from here: https://opendata.dc.gov/datasets/DCGIS::zoning-boundaries-zoning-regulations-of-2016/about
zone_shp <- sf::st_read("zoning/Zoning_Boundaries_(Zoning_Regulations_of_2016).shp")
## Reading layer `Zoning_Boundaries_(Zoning_Regulations_of_2016)' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\zoning\Zoning_Boundaries_(Zoning_Regulations_of_2016).shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 953 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -8584936 ymin: 4691870 xmax: -8561487 ymax: 4721094
## Projected CRS: WGS 84 / Pseudo-Mercator
# load & clean census tract data
# please see https://opendata.dc.gov/datasets/DCGIS::census-tracts-in-1970/about
# for example, for more details on variable names
load_clean_tracts <- function(geo_id_var, black_var, white_var, totpop_var, year) {
  # Loads the shapefile, removes unneeded columns, calculates the tract area in meters^2
  shp <- sf::st_read(paste0("tract_data/Census_Tracts_in_", year, 
                            "/Census_Tracts_in_", year, ".shp")) 
  shp <- shp %>% 
    rename("geo_id" = !!sym(geo_id_var),
           "n_black" = !!sym(black_var),
           "n_white" = !!sym(white_var),
           "n_tot" = !!sym(totpop_var)
           ) %>%
    select("geo_id", starts_with("n_")) %>%
    mutate(n_other = n_tot - (n_black + n_white),
           year = year)
  shp$geo_area_meters <- sf::st_area(shp)
  shp <- sf::st_transform(shp, 4326)
  
  return(shp %>% select("year", "geo_id", "n_tot", "n_black", "n_white", "n_other", "geo_area_meters", "geometry"))
}


clean_block_data <- function(shp, df, shp_b_id, df_b_id, var_prefix, df_n_black, df_n_white, drop_var="", year) {
  shp <- shp %>% select(!!sym(shp_b_id)) %>% rename("geo_id" = !!sym(shp_b_id))
  if (drop_var!="") {df <- df %>% select(-!!sym(drop_var))}
  df <- df %>% 
    select(!!sym(df_b_id), starts_with(var_prefix)) %>%
    rowwise() %>%
    mutate(n_tot = sum(c_across(starts_with(var_prefix))))
    
  df <- df %>%
    rename("geo_id" = !!sym(df_b_id),
           "n_black" = !!sym(df_n_black),
           "n_white" = !!sym(df_n_white)) %>%
    select(-starts_with(var_prefix)) %>%
    mutate(n_other = n_tot - (n_black + n_white))
  
  shp <- dplyr::left_join(shp, df, by="geo_id")
  shp <- sf::st_transform(shp, 4326)
  shp$geo_area_meters <- sf::st_area(shp)
  shp$year <- year
  
  return(shp)
}


# Load raw block data:
  
# b70_shp <- sf::st_read("block_shapes/US_block_1970/US_block_1970.shp")
# b70_shp <- b70_shp[b70_shp$STATE70=="11",]
# sf::st_write(b70_shp, "block_shapes/DC_block_1970/DC_block_1970.shp")

b70_shp <- sf::st_read("block_shapes/DC_block_1970/DC_block_1970.shp")
## Reading layer `DC_block_1970' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\DC_block_1970\DC_block_1970.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 4665 features and 6 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610795 ymin: 308338.5 xmax: 1629412 ymax: 329313.2
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b80_shp <- sf::st_read("block_shapes/DC_block_1980/DC_block_1980.shp")
## Reading layer `DC_block_1980' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\DC_block_1980\DC_block_1980.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 4627 features and 10 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610795 ymin: 308338.5 xmax: 1629412 ymax: 329313.2
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b90_shp <- sf::st_read("block_shapes/nhgis0092_shapefile_tl2000_110_block_1990/DC_block_1990.shp")
## Reading layer `DC_block_1990' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\nhgis0092_shapefile_tl2000_110_block_1990\DC_block_1990.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 5140 features and 5 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610795 ymin: 308338.5 xmax: 1629412 ymax: 329313.2
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b00_shp <- sf::st_read("block_shapes/nhgis0092_shapefile_tl2000_110_block_2000/DC_block_2000.shp")
## Reading layer `DC_block_2000' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\nhgis0092_shapefile_tl2000_110_block_2000\DC_block_2000.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 5626 features and 6 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610795 ymin: 308338.5 xmax: 1629412 ymax: 329313.2
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b10_shp <- sf::st_read("block_shapes/nhgis0092_shapefile_tl2010_110_block_2010/DC_block_2010.shp")
## Reading layer `DC_block_2010' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\nhgis0092_shapefile_tl2010_110_block_2010\DC_block_2010.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 6426 features and 18 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610830 ymin: 308504.6 xmax: 1629412 ymax: 329361
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b20_shp <- sf::st_read("block_shapes/nhgis0092_shapefile_tl2020_110_block_2020/DC_block_2020.shp")
## Reading layer `DC_block_2020' from data source 
##   `C:\Users\edwar\Documents\GitHub\hd_analysis\block_shapes\nhgis0092_shapefile_tl2020_110_block_2020\DC_block_2020.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 5935 features and 18 fields
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: 1610830 ymin: 308504.6 xmax: 1629412 ymax: 329396
## Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic
b70_df <- readr::read_csv("block_data/nhgis0093_ds96_1970_block.csv")
b80_df <- readr::read_csv("block_data/nhgis_ds104_1980_block_11.csv")
b90_df <- readr::read_csv("block_data/nhgis0092_ds120_1990_block.csv")
b00_df <- readr::read_csv("block_data/nhgis0092_ds147_2000_block.csv")
b10_df <- readr::read_csv("block_data/nhgis0092_ds172_2010_block.csv")
b20_df <- readr::read_csv("block_data/nhgis0092_ds258_2020_block.csv")

# 1970 block data has to be specially cleaned, see https://forum.ipums.org/t/race-ethnicity-data-at-a-block-level-from-1970/6178
b70_df$c_black <- b70_df$CM6001 + b70_df$CM6002
b70_df$c_other <- b70_df$CM6003 + b70_df$CM6004
b70_df$c_white <- b70_df$CM5001 + b70_df$CM5002 - b70_df$c_black - b70_df$c_other

Clean tracts for 1960 and blocks for all later decades:

# turn off spherical geometry (s2)
sf_use_s2(FALSE)

# need to fix broken geometries:
fix_geo_if_broken <- function(shp) {
  if (min(sf::st_is_valid(shp)) == 0) {
    print("Fixing geometry...")
    return(sf::st_make_valid(shp))
  } else {
      return(shp)
    }
  }

zone_shp <- fix_geo_if_broken(zone_shp)
hd_shp <- fix_geo_if_broken(hd_shp)
ward_shp <- fix_geo_if_broken(ward_shp)
b70_shp <- fix_geo_if_broken(b70_shp)
b80_shp <- fix_geo_if_broken(b80_shp)
b90_shp <- fix_geo_if_broken(b90_shp)
b10_shp <- fix_geo_if_broken(b10_shp)
b20_shp <- fix_geo_if_broken(b20_shp)


b60_shp <- load_clean_tracts("GISJOIN", "B58013", "B58011", "CA4001", 1960)
b60_shp <- fix_geo_if_broken(b60_shp)
# in an older version of this analysis, I ran everything using tracts;
# you can uncomment the lines below to load the tract data and do that
# b70_shp <- load_clean_tracts("GISJOIN", "CEB03", "CEB01", "CY7001", 1970) 
# b80_shp <- load_clean_tracts("GISJOIN", "C9D003", "C9D001", "C7L001", 1980)
# b90_shp <- load_clean_tracts("TRACTNO", "BLACK", "WHITE", "POPULATION", 1990)
# b00_shp <- load_clean_tracts("TRACTNO", "BLACK", "WHITE", "TOTAL", 2000)
# b10_shp <- load_clean_tracts("TRACT", "P0010004", "P0010003", "P0010001", 2010)
# b20_shp <- load_clean_tracts("TRACT", "P0010004", "P0010003", "P0010001", 2020)
gc()

b70_shp <- clean_block_data(b70_shp, b70_df, "GISJOIN", "GISJOIN", "c_", "c_black", "c_white", year=1970)
b80_shp <- clean_block_data(b80_shp, b80_df, "GISJOIN", "GISJOIN", "C9D0", "C9D002", "C9D001", year=1980)
b90_shp <- clean_block_data(b90_shp, b90_df, "GISJOIN", "GISJOIN", "EUY0", "EUY002", "EUY001", year=1990)
b00_shp <- clean_block_data(b00_shp, b00_df, "GISJOIN", "GISJOIN", "FYE0", "FYE002", "FYE001", year=2000)
b10_shp <- clean_block_data(b10_shp, b10_df, "GISJOIN", "GISJOIN", "H7X", "H7X003", "H7X002", "H7X001", year=2010)
b20_shp <- clean_block_data(b20_shp, b20_df, "GISJOIN", "GISJOIN", "U7J", "U7J003", "U7J002", "U7J001", year=2020)

rm(b70_df, b80_df, b90_df, b00_df, b10_df, b20_df)

gc()

Merge historic district (HD) data onto HD shapefile, subset to only look at neighborhood HDs:

hd_shp <- dplyr::left_join(x = hd_shp, y = hd_data, by = "UNIQUEID")
hd_shp <- hd_shp[hd_shp$Neighborhood_HD==1,]

Transform shape files to mercator projection:

# convert to mercator projection
zone_shp <- sf::st_transform(zone_shp, 4326)
hd_shp <- sf::st_transform(hd_shp, 4326)
ward_shp <- sf::st_transform(ward_shp, 4326)

Initial descriptive statistics

Let’s overlay HDs onto DC’s zoning map.

# list zones:
zones_list <- sort(unique(zone_shp$ZR16))
housing_zones <- zones_list[grep(x=zones_list, pattern = "^R|^MU")]
# subset
zone_shp <- zone_shp[zone_shp$ZR16 %in% housing_zones,]

# create simplified labels
zone_shp$ZR16_simple <- "Other"
zone_shp$ZR16_simple[grep(x=zone_shp$ZR16, pattern="^RA-")] <- "Apartment zones"
zone_shp$ZR16_simple[grep(x=zone_shp$ZR16, pattern="^R-")] <- "Residential zones"
zone_shp$ZR16_simple[grep(x=zone_shp$ZR16, pattern="^RF-")] <- "Residential flat zones"
zone_shp$ZR16_simple[grep(x=zone_shp$ZR16, pattern="^MU-")] <- "Mixed use zones"

# show on a map:
factpal <- colorFactor(palette = "Set1", domain = zone_shp$ZR16_simple)

leaflet(zone_shp) %>%
  addProviderTiles(providers$CartoDB.Positron) %>%
  addPolygons(fillColor = ~factpal(ZR16_simple), # Apply the color function
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~ZR16,
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = TRUE
        )
  ) %>%
  addLegend(pal = factpal, values = ~ZR16_simple, opacity = 0.7, title = NULL,
    position = "bottomright")

Calculate the total amount of residential and MU land in DC:

zone_shp$area_meters <- sf::st_area(zone_shp)
zone_shp$area_acres <- as.vector(zone_shp$area_meters * 0.000247105)
total_zone_acres <- sum(zone_shp$area_acres, na.rm=T)

Total and % of land area covered by HDs over time:

# get shape areas:
hd_shp$area_meters <- sf::st_area(hd_shp)
hd_shp$area_acres <- as.vector(hd_shp$area_meters * 0.000247105)

years <- c(1960, 1970, 1980, 1990, 2000, 2010, 2025)
land_areas <- rep(NA, length(years))
counter <- 1
for (year in years) { # Land area covered by HDs by year:
  land_area <- sum(hd_shp$area_acres[hd_shp$desig_date < year])
  land_areas[counter] <- land_area
  counter <- counter + 1
}

p <- data.frame(years, land_areas, round(100*land_areas / total_zone_acres,0))
names(p) <- c("Year", 
              "Area covered by by Historic Districts, in Acres",
              "Percent of 2016 residential zone covered by Neighborhood HD")
plot1 <-
  ggplot(p, 
       aes(x=Year, 
           y=`Area covered by by Historic Districts, in Acres`)) + 
  geom_bar(stat = "identity", fill="#0f9535") +
  geom_text(aes(label = round(`Area covered by by Historic Districts, in Acres`, 0), vjust = -1.7)) +
  ylab("Acres") +
  theme_minimal() +
  ggtitle('Acres covered by "neighborhood historic districts"\nhas steadily increased over time')

plot2 <-
  ggplot(p, 
       aes(x=Year, 
           y=`Percent of 2016 residential zone covered by Neighborhood HD`)) + 
  geom_line(color="#0f9535", size=.75) +
  geom_point(color="#0f9535") +
  geom_text(aes(label = paste0(`Percent of 2016 residential zone covered by Neighborhood HD`, "%")), vjust = -1.7) +
  theme_minimal() +
  ylab("Percent") +
  ggtitle('And the % of residential area covered\nby HDs has more than doubled since 1980')

plot1 + plot2

Let’s quickly compare which HDs were designated before vs after 1980:

hd_shp$flag_1980 <- 0
hd_shp$flag_1980[hd_shp$desig_date < 1980] <- 1

leaflet() %>%
  addProviderTiles(providers$CartoDB.Positron) %>%
  addPolygons(group= "Designated before 1980",
              data=hd_shp[hd_shp$flag_1980==1,],
              fillColor = "skyblue", 
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~LABEL,
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = FALSE
        ) 
  ) %>%
  addPolygons(group= "Designated after 1980",
              data=hd_shp[hd_shp$flag_1980==0,],
              fillColor = "hotpink", 
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~LABEL,
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = FALSE
        ) 
  ) %>%
  addLayersControl(
    overlayGroups = c("Designated before 1980", "Designated after 1980"),
    options = layersControlOptions(collapsed = FALSE)
  )

We’ll remove some very small HDs for the next part (like HDs that are a single circle):

# Drop some very small HDs that are like a single circle
# We just dropped anything smaller than 10 acres
hd_shp <-
  hd_shp %>%
  filter(!(LABEL %in% c("Emerald St HD",
                       "Grant Rd HD",
                       "Mount Vernon Triangle HD",
                       "Grant Circle HD",
                       "Union Market"
                       )))

Demographic change analysis

Now let’s look and see how HDs changed over time, in terms of % black residents and % white residents, compared to nearby neighborhoods (groups of blocks) that were not in HDs.

This will have a few steps:

  1. Take a given HD.
  2. Get the intersection of the HD with census tracts (in 1960) and blocks (in 1970 to 2020). If at least X% of the census tract area is in the HD, we’ll count it as part of the HD.
  3. Create a buffer around the HD of distance Y. Run another intersection with the census tracts/blocks and that buffer. Count any tracts/blocks that touch the buffer but are not in an HD as comparison tracts.
  4. Note the % of white and black residents in each HD and those HDs comparison tracts/blocks.
  5. See how those respective percentages change over time.

Function to find which tracts/blocks are in which HDs:

get_geos_in_hd <- function(shp, min_pct, year) {
  # This function gets the tracts that are in each HD in a given year
  # shp: the tract or block shapefile (an sf shapefile object)
  # min_pct: the minimum % of the tract or block that must be in the HD to count as part of the HD (a decimal # between 0 and 1)
  # year: the year (an integer like 1980)
  i <- sf::st_intersection(x=shp, y=hd_shp)
  i$i_area <- sf::st_area(i)
  i$pct_of_geo_area <- as.vector(i$i_area / i$geo_area_meters)
  
  geos_in_hd <- i[i$pct_of_geo_area > min_pct, 
                    c("year", "geo_id", "LABEL",
                      "n_tot", "n_black", "n_white", "n_other",
                      "desig_date", "pct_of_geo_area")]
  geos_in_hd_summary <-
    geos_in_hd %>%
    mutate(n_tot_prorated = n_tot * pct_of_geo_area,
           n_black_prorated = n_black * pct_of_geo_area,
           n_white_prorated = n_white * pct_of_geo_area,
           n_other_prorated = n_other * pct_of_geo_area) %>%
    select("year", "LABEL", "geo_id", starts_with("n_"), "desig_date") %>%
    group_by(LABEL) %>%
      summarise(n_tot = sum(n_tot, na.rm=T),
                n_black = sum(n_black, na.rm=T),
                n_white = sum(n_white, na.rm=T),
                n_other = sum(n_other, na.rm=T),
                n_tot_prorated = sum(n_tot_prorated, na.rm=T),
                n_black_prorated = sum(n_black_prorated, na.rm=T),
                n_white_prorated = sum(n_white_prorated, na.rm=T),
                n_other_prorated = sum(n_other_prorated, na.rm=T),
                desig_year = max(desig_date, na.rm=T)) %>%
    mutate(desig_yet = ifelse(desig_year<year, 1, 0), 
           year = year)
  
    rv = list("geos_in_hd"=geos_in_hd, "summary"=sf::st_drop_geometry(geos_in_hd_summary))
    
    return(rv)
}

Function to find which tracts/blocks are nearby but not inside the HDs:

get_neighbor_geos <- function(hd_shp, geo_shp, buffer_dist, geos_in_hd, remove_geo_thresh, year) {
  # first make a buffer around the HDs
  b <- sf::st_buffer(hd_shp, dist = buffer_dist)
  # then get the intersection of the buffer and the tracts
  i <- sf::st_intersection(x=geo_shp, y=b)
  # remove tracts that have already been classified as within an HD
  i <- i[!(i$geo_id %in% geos_in_hd$geos_in_hd$geo_id),]
  # also remove any tracts/blocks for which more than X% of an HD is in that tract/block
  hd_shp$area_meters <- sf::st_area(hd_shp)
  hd_geo <- sf::st_intersection(x=geo_shp, y=hd_shp)
  hd_geo$intersect_area <- sf::st_area(hd_geo)
  hd_geo$pct_area <- as.vector(hd_geo$intersect_area / hd_geo$area_meters)
  geos_to_remove <- hd_geo$geo_id[hd_geo$pct_area > remove_geo_thresh]
  neighboring_geos <- i[!(i$geo_id %in% geos_to_remove),]
  
  # finally, remove
  neighboring_geos <- geo_shp[geo_shp$geo_id %in% neighboring_geos$geo_id,]
  neighboring_geos <- dplyr::left_join(neighboring_geos, 
                                         sf::st_drop_geometry(i[,c("geo_id", "LABEL", "desig_date")]),
                                         by="geo_id")
  
  neighbor_geos_summary <-
    sf::st_drop_geometry(neighboring_geos) %>%
    group_by(LABEL) %>%
      summarise(n_tot = sum(n_tot, na.rm=T),
                n_black = sum(n_black, na.rm=T),
                n_white = sum(n_white, na.rm=T),
                n_other = sum(n_other, na.rm=T),
                desig_year = max(desig_date, na.rm=T)) %>%
    mutate(desig_yet = ifelse(desig_year<year, 1, 0),
           year = year)
  
  rv = list("buffers" = b, 
            "neighbor_geos" = neighboring_geos, 
            "neighbor_geos_summary" = neighbor_geos_summary)
  
  return(rv)
}

Function to map those tracts/blocks and see if everything looks good:

plot_geos <- function(geo_shp, nearby_geos_shp, geos_in_hds) {
  rv <-
    leaflet() %>%
  addProviderTiles(providers$CartoDB.Positron) %>%
  addPolygons(group='buffers', data=nearby_geos_shp[["buffers"]]) %>%
  addPolygons(group= "geos labeled as near HDs",
              data=nearby_geos_shp[["neighbor_geos"]],
              fillColor = "skyblue", 
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~paste0("Geo: ", geo_id, "; HD neighbor: ", LABEL),
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = FALSE
        ) 
  ) %>%
    addPolygons(group= "geos labeled as in HDs",
              data=geo_shp[geo_shp$geo_id %in% geos_in_hds, ],
              fillColor = "limegreen", 
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~geo_id,
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = FALSE
        ) 
  ) %>%
  addPolygons(group= "HDs",
              data=hd_shp,
              fillColor = "hotpink", 
              fillOpacity = 0.7,
              weight = 1,
              opacity = 1,
              color = "white",
              label=~LABEL,
              highlightOptions = highlightOptions(weight = 3,
                                                  color = "white",
                                                  bringToFront = FALSE
        ) 
  ) %>%
  addLayersControl(
    overlayGroups = c("geos labeled as near HDs", "geos labeled as in HDs", "HDs", "buffers"),
    options = layersControlOptions(collapsed = FALSE)
  )
  
  return(rv)
}

Function to run regressions:

run_regressions <- function(hd_comp_df, near_comp_df) {
  
  near_comp_df$LABEL <- gsub(x = near_comp_df$LABEL, pattern = " HD", replacement = "")
  hd_comp_df$LABEL <- gsub(x = hd_comp_df$LABEL, pattern = " HD", replacement = "")
  
  hd_comp_df <-
    hd_comp_df %>%
    select(-ends_with("_prorated"), -desig_year) %>%
    group_by(LABEL, desig_yet, year) %>%
    summarise_all(., sum) %>%
    mutate(pct_black = n_black / n_tot,
           pct_white = n_white / n_tot) %>%
    rename_with(~ paste0(., "_hd"))
  
  near_comp_df <-
    near_comp_df %>%
    select(-desig_year) %>%
    group_by(LABEL, desig_yet, year) %>%
    mutate(pct_black = n_black / n_tot,
           pct_white = n_white / n_tot) %>%
    summarise_all(., sum) %>%
    rename_with(~ paste0(., "_near"))
  
  
  comp_df <- dplyr::full_join(x = hd_comp_df, 
                              y = near_comp_df, 
                              by = c("LABEL_hd"="LABEL_near", 
                                     "desig_yet_hd"="desig_yet_near",
                                     "year_hd"="year_near")) 
  
  comp_df_copy <- comp_df
  comp_df <- comp_df %>% select(starts_with(c("LABEL", "desig_yet", "year", "pct_")))
  
  comp_df <-
    comp_df %>%
    tidyr::pivot_longer(
      cols = starts_with("pct_"),
      names_to = c("group", "treatment_control"),
      names_pattern = "pct_([a-zA-Z]+)_([a-zA-Z]+)",
      values_to = "percent")
  
  comp_df <- dplyr::left_join(x = comp_df, 
                              y = comp_df_copy %>% select("LABEL_hd", "desig_yet_hd", "year_hd", "n_tot_hd"), 
                              by = c("LABEL_hd", 
                                     "desig_yet_hd",
                                     "year_hd")) %>%
    rename(LABEL = "LABEL_hd",
           desig_yet = "desig_yet_hd",
           year = "year_hd")
  
  # remove HDs that are always HDs or always not HDs during the timeframe
  comp_df <-
    comp_df %>%
    group_by(LABEL) %>%
    mutate(mean_status = mean(desig_yet, na.rm=T)) %>%
    filter(mean_status > 0) %>%
    filter(mean_status < 1)
  
  comp_df$treatment_group <- 0
  comp_df$treatment_group[comp_df$treatment_control=="hd"] <- 1 
  
  comp_df$unit_id <- paste(comp_df$LABEL, comp_df$treatment_control, sep = " ")
  
  # add back total population values
  names(hd_comp_df) <- gsub(x = names(hd_comp_df), pattern = "_hd", replacement = "")
  names(near_comp_df) <- gsub(x = names(near_comp_df), pattern = "_near", replacement = "")
  hd_comp_df$pop_in_unit <- hd_comp_df$n_tot
  near_comp_df$pop_in_unit <- near_comp_df$n_tot
  hd_comp_df$treatment_control <- "hd"
  near_comp_df$treatment_control <- "near"
  
  to_add <-
    dplyr::bind_rows(
      hd_comp_df %>% ungroup() %>% select(LABEL, year, treatment_control, pop_in_unit),
      near_comp_df %>% ungroup() %>% select(LABEL, year, treatment_control, pop_in_unit)
    )
  
  comp_df <- dplyr::left_join(x = comp_df, 
                              y = to_add,
                              by = c("LABEL", "year", "treatment_control"))
  
  comp_df$unit_id  <- as.factor(comp_df$unit_id)
  comp_df$LABEL    <- as.factor(comp_df$LABEL)
  comp_df$year     <- as.factor(comp_df$year)
  
  for (grp in c("black", "white")) {
    comp_df_subset <- comp_df[comp_df$group==grp,]
    for (w in c("1", "n_tot_hd")) {
      if (w == "1") {wt=rep(1, nrow(comp_df_subset))} else {wt=comp_df_subset$n_tot_hd}
      # diff in diff analysis for change in the % of residents
      main_formula <- percent ~                            # outcome: % of white or black residents
                           treatment_group +               # "treatment": whether tract is in a HD or not
                           desig_yet +                     # pre/post indicator: whether HD was designated yet
                           treatment_group:desig_yet +     # D-in-D estimator: effect of treatment after implemented
                           unit_id  +                      # fixed effect for each specific area (eg Anacostia HD, Anacostia nearby, etc)
                           year                           # fixed effect for year
      w_label_formula <- update(main_formula, . ~ . + LABEL)
      
      diff_in_diff <- lm(main_formula, data = comp_df_subset, weights=wt)
      dind_w_label <- lm(w_label_formula, data = comp_df_subset, weights=wt)
      
      print("_______________________________________________________")
      print(paste0("D-in-D regression for the % of ", grp, " residents, ",
                   ifelse(w=="1", "unweighted", "using population weights")))
      print(summary(diff_in_diff))
      print("__________")
      print("Coef. on treatment variable when we add area fixed effects:")
      print(summary(dind_w_label)$coefficients["treatment_group:desig_yet",])
      # plot(diff_in_diff)
      
    }
  }
    
  
  comp_df <-
    comp_df %>%
    group_by(LABEL, desig_yet) %>%
    mutate(first_decade_desig=min(as.numeric(as.character(year)))) %>%
    mutate(first_decade_desig=ifelse(desig_yet==0, 0, first_decade_desig)) %>%
    ungroup() %>%
    group_by(LABEL) %>%
    mutate(first_decade_desig=max(first_decade_desig)) %>%
    mutate(year_index = as.numeric(as.character(year)) - first_decade_desig)
  
  comp_df$first_decade_desig[comp_df$treatment_control=="near"] <- 0
  comp_df$year     <- as.numeric(as.character((comp_df$year)))
  comp_df <- comp_df %>%
          group_by(unit_id) %>%
          mutate(unit_id_num = cur_group_id())
  
  
  # Alternate specification:
  # https://bcallaway11.github.io/did/articles/did-basics.html#an-example-with-real-data
  # https://cran.r-project.org/web/packages/did/vignettes/pre-testing.html
      hd.attgt <- did::att_gt(yname = "percent",
                   gname = "first_decade_desig",
                   idname = "unit_id_num",
                   tname = "year",
                   xformla = ~1,
                   data = comp_df[comp_df$group=="black" & !is.na(comp_df$n_tot_hd),],
                   allow_unbalanced_panel = T,
                   weightsname="n_tot_hd"
                   )
      print(summary(hd.attgt))
      group_effects <- aggte(hd.attgt, type = "group", na.rm=T)
      print(summary(group_effects))
    
  return(comp_df)
}

One function to run everything above (we’ll use this for robustness checks):

run_all <- function(mp, buff_dist, threshold) {
  hd_geos60 <- get_geos_in_hd(b60_shp, min_pct = mp, year = 1960)
  hd_geos70 <- get_geos_in_hd(b70_shp, min_pct = mp, year = 1970)
  hd_geos80 <- get_geos_in_hd(b80_shp, min_pct = mp, year = 1980)
  hd_geos90 <- get_geos_in_hd(b90_shp, min_pct = mp, year = 1990)
  hd_geos00 <- get_geos_in_hd(b00_shp, min_pct = mp, year = 2000)
  hd_geos10 <- get_geos_in_hd(b10_shp, min_pct = mp, year = 2010)
  hd_geos20 <- get_geos_in_hd(b20_shp, min_pct = mp, year = 2020)
  gc()
  nearby_geos60 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b60_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos70,threshold, 1960)
  nearby_geos70 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b70_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos70,threshold, 1970)
  nearby_geos80 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b80_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos80,threshold, 1980)
  nearby_geos90 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b90_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos90,threshold, 1990)
  gc()
  nearby_geos00 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b00_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos00,threshold, 2000)
  nearby_geos10 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b10_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos10,threshold, 2010)
  nearby_geos20 <- 
    get_neighbor_geos(hd_shp=hd_shp, geo_shp=b20_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos20,threshold, 2020)
  gc()
  
  plot_geos(b60_shp, nearby_geos60, hd_geos60$geos_in_hd$geo_id)
      
  hd_comp_df <- dplyr::bind_rows(hd_geos60[[2]], hd_geos70[[2]], hd_geos80[[2]], hd_geos90[[2]],
                              hd_geos00[[2]], hd_geos10[[2]], hd_geos20[[2]],)
  near_comp_df <- dplyr::bind_rows(nearby_geos60[[3]], nearby_geos70[[3]],nearby_geos80[[3]], nearby_geos90[[3]],
                              nearby_geos00[[3]], nearby_geos10[[3]], nearby_geos20[[3]],)
  
  comp_df <- run_regressions(hd_comp_df, near_comp_df)
}

Call all the functions we created above for our preferred model specification:

# ranging the min % between .2 and .6 seems to give reasonable results
mp = 0.25 
hd_geos60 <- get_geos_in_hd(b60_shp, min_pct = mp, year = 1960)
hd_geos70 <- get_geos_in_hd(b70_shp, min_pct = mp, year = 1970)
hd_geos80 <- get_geos_in_hd(b80_shp, min_pct = mp, year = 1980)
hd_geos90 <- get_geos_in_hd(b90_shp, min_pct = mp, year = 1990)
hd_geos00 <- get_geos_in_hd(b00_shp, min_pct = mp, year = 2000)
hd_geos10 <- get_geos_in_hd(b10_shp, min_pct = mp, year = 2010)
hd_geos20 <- get_geos_in_hd(b20_shp, min_pct = mp, year = 2020)
gc()
##           used  (Mb) gc trigger  (Mb) max used  (Mb)
## Ncells 3120693 166.7    5133892 274.2  5133892 274.2
## Vcells 8352570  63.8   17562944 134.0 17441635 133.1
# the buffer distance is in decimal degrees
buff_dist = .005
threshold = .1

nearby_geos60 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b60_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos70,threshold, 1960)
nearby_geos70 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b70_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos70,threshold, 1970)
nearby_geos80 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b80_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos80,threshold, 1980)
nearby_geos90 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b90_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos90,threshold, 1990)
gc()
##           used  (Mb) gc trigger  (Mb) max used  (Mb)
## Ncells 3122377 166.8    5133892 274.2  5133892 274.2
## Vcells 8497204  64.9   17562944 134.0 17441635 133.1
nearby_geos00 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b00_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos00,threshold, 2000)
nearby_geos10 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b10_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos10,threshold, 2010)
nearby_geos20 <- 
  get_neighbor_geos(hd_shp=hd_shp, geo_shp=b20_shp, buffer_dist=buff_dist, geos_in_hd=hd_geos20,threshold, 2020)
gc()
##           used  (Mb) gc trigger  (Mb) max used  (Mb)
## Ncells 3123223 166.8    5133892 274.2  5133892 274.2
## Vcells 8635209  65.9   17562944 134.0 17441635 133.1

Plot our classifications in 1960 and 2020, as a gut check:

plot_geos(b60_shp, nearby_geos60, hd_geos60$geos_in_hd$geo_id)
plot_geos(b20_shp, nearby_geos20, hd_geos20$geos_in_hd$geo_id)

Now compare the demographics of the HD tracts and their neighbors in each year:

options(width = 200)

hd_comp_df <- dplyr::bind_rows(hd_geos60[[2]], hd_geos70[[2]], hd_geos80[[2]], hd_geos90[[2]],
                            hd_geos00[[2]], hd_geos10[[2]], hd_geos20[[2]],)
near_comp_df <- dplyr::bind_rows(nearby_geos60[[3]], nearby_geos70[[3]],nearby_geos80[[3]], nearby_geos90[[3]],
                            nearby_geos00[[3]], nearby_geos10[[3]], nearby_geos20[[3]],)

comp_df <- run_regressions(hd_comp_df, near_comp_df)
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.47429 -0.09403 -0.00972  0.09551  0.38130 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.130434   0.058693   2.222  0.02692 *  
## treatment_group                         0.922730   0.083307  11.076  < 2e-16 ***
## desig_yet                              -0.037829   0.030718  -1.231  0.21900    
## unit_idAnacostia near                   0.811583   0.077542  10.466  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.487935   0.083855  -5.819 1.38e-08 ***
## unit_idBlagden Alley/Naylor Court near  0.568061   0.077043   7.373 1.29e-12 ***
## unit_idBloomingdale hd                 -0.197506   0.082673  -2.389  0.01744 *  
## unit_idBloomingdale near                0.721953   0.077542   9.311  < 2e-16 ***
## unit_idCapitol Hill hd                 -0.580298   0.080308  -7.226 3.33e-12 ***
## unit_idCapitol Hill near                0.632493   0.077542   8.157 6.83e-15 ***
## unit_idCleveland Park hd               -0.903433   0.080542 -11.217  < 2e-16 ***
## unit_idCleveland Park near             -0.021865   0.077168  -0.283  0.77709    
## unit_idDowntown hd                     -0.783969   0.084647  -9.262  < 2e-16 ***
## unit_idDowntown near                    0.501791   0.077168   6.503 2.84e-10 ***
## unit_idDupont Circle hd                -0.760899   0.080308  -9.475  < 2e-16 ***
## unit_idDupont Circle near               0.070821   0.077542   0.913  0.36172    
## unit_idFinancial hd                    -0.857971   0.087580  -9.796  < 2e-16 ***
## unit_idFinancial near                   0.354367   0.080438   4.405 1.42e-05 ***
## unit_idFoggy Bottom hd                 -0.908592   0.083376 -10.897  < 2e-16 ***
## unit_idFoggy Bottom near                0.014543   0.077168   0.188  0.85063    
## unit_idFoxhall hd                      -0.967321   0.084647 -11.428  < 2e-16 ***
## unit_idFoxhall near                    -0.049289   0.077168  -0.639  0.52344    
## unit_idGeorgetown hd                   -0.890814   0.080319 -11.091  < 2e-16 ***
## unit_idGeorgetown near                 -0.023354   0.078160  -0.299  0.76528    
## unit_idGreater 14th St hd              -0.552213   0.081016  -6.816 4.31e-11 ***
## unit_idGreater 14th St near             0.449558   0.080272   5.600 4.43e-08 ***
## unit_idGreater U St hd                 -0.350123   0.081016  -4.322 2.04e-05 ***
## unit_idGreater U St near                0.638399   0.077043   8.286 2.78e-15 ***
## unit_idGWU / Old West End hd           -0.941838   0.085744 -10.984  < 2e-16 ***
## unit_idGWU / Old West End near         -0.011489   0.077542  -0.148  0.88230    
## unit_idKalorama Triangle hd            -0.855285   0.080542 -10.619  < 2e-16 ***
## unit_idKalorama Triangle near           0.192554   0.077168   2.495  0.01306 *  
## unit_idKingman Park hd                 -0.072272   0.085744  -0.843  0.39989    
## unit_idKingman Park near                0.821193   0.077542  10.590  < 2e-16 ***
## unit_idLafayette Square hd             -0.927747   0.093206  -9.954  < 2e-16 ***
## unit_idLafayette Square near            0.105161   0.077542   1.356  0.17594    
## unit_idLeDroit Park hd                 -0.140559   0.083216  -1.689  0.09213 .  
## unit_idLeDroit Park near                0.754984   0.077542   9.737  < 2e-16 ***
## unit_idLogan Circle hd                 -0.497631   0.083216  -5.980 5.68e-09 ***
## unit_idLogan Circle near                0.486918   0.080929   6.017 4.63e-09 ***
## unit_idMassachusetts Ave hd            -0.841631   0.083216 -10.114  < 2e-16 ***
## unit_idMassachusetts Ave near           0.007874   0.077542   0.102  0.91918    
## unit_idMeridian Hill hd                -0.563742   0.085744  -6.575 1.85e-10 ***
## unit_idMeridian Hill near               0.462506   0.077542   5.965 6.18e-09 ***
## unit_idMt. Pleasant hd                 -0.633671   0.080542  -7.868 4.93e-14 ***
## unit_idMt. Pleasant near                0.435752   0.077168   5.647 3.47e-08 ***
## unit_idMt. Vernon Square hd            -0.301607   0.083855  -3.597  0.00037 ***
## unit_idMt. Vernon Square near           0.685990   0.077043   8.904  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd         -0.605388   0.081016  -7.472 6.80e-13 ***
## unit_idPennsylvania Ave NHS near        0.479856   0.077043   6.228 1.40e-09 ***
## unit_idShaw hd                         -0.405816   0.081016  -5.009 8.83e-07 ***
## unit_idShaw near                        0.578123   0.077043   7.504 5.53e-13 ***
## unit_idSheridan-Kalorama hd            -0.915646   0.080542 -11.369  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.002934   0.077168  -0.038  0.96970    
## unit_idSixteenth St hd                 -0.682972   0.083216  -8.207 4.82e-15 ***
## unit_idSixteenth St near                0.508709   0.077542   6.560 2.01e-10 ***
## unit_idStrivers' Section hd            -0.608052   0.083376  -7.293 2.17e-12 ***
## unit_idStrivers' Section near           0.464047   0.080438   5.769 1.80e-08 ***
## unit_idTakoma Park hd                  -0.388287   0.083376  -4.657 4.62e-06 ***
## unit_idTakoma Park near                 0.563601   0.077168   7.304 2.03e-12 ***
## unit_idWashington Heights hd           -0.723939   0.084647  -8.552 4.25e-16 ***
## unit_idWashington Heights near          0.222580   0.077168   2.884  0.00417 ** 
## unit_idWoodley Park hd                 -0.915748   0.083855 -10.921  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                                0.049188   0.030209   1.628  0.10440    
## year1980                                0.054932   0.031171   1.762  0.07893 .  
## year1990                                0.023545   0.033524   0.702  0.48296    
## year2000                               -0.036678   0.036620  -1.002  0.31726    
## year2010                               -0.142371   0.038114  -3.735  0.00022 ***
## year2020                               -0.188495   0.040178  -4.691 3.95e-06 ***
## treatment_group:desig_yet              -0.068931   0.031810  -2.167  0.03093 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1441 on 338 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.8473, Adjusted R-squared:  0.8162 
## F-statistic: 27.19 on 69 and 338 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## -0.06893144  0.03180993 -2.16697877  0.03093455 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -39.990  -4.859   0.000   4.833  23.830 
## 
## Coefficients: (1 not defined because of singularities)
##                                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.1848001  0.0725302   2.548 0.011306 *  
## treatment_group                         0.8996335  0.0895923  10.041  < 2e-16 ***
## desig_yet                              -0.0524040  0.0283300  -1.850 0.065271 .  
## unit_idAnacostia near                   0.8558270  0.0880583   9.719  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.4389288  0.1580740  -2.777 0.005815 ** 
## unit_idBlagden Alley/Naylor Court near  0.5085265  0.1640699   3.099 0.002112 ** 
## unit_idBloomingdale hd                 -0.1858191  0.0696784  -2.667 0.008048 ** 
## unit_idBloomingdale near                0.6866703  0.0815891   8.416 1.33e-15 ***
## unit_idCapitol Hill hd                 -0.5349496  0.0572505  -9.344  < 2e-16 ***
## unit_idCapitol Hill near                0.6213747  0.0729645   8.516 6.60e-16 ***
## unit_idCleveland Park hd               -0.8663982  0.0708741 -12.224  < 2e-16 ***
## unit_idCleveland Park near             -0.0250751  0.0837852  -0.299 0.764923    
## unit_idDowntown hd                     -0.7154173  0.1303417  -5.489 8.26e-08 ***
## unit_idDowntown near                    0.4522019  0.1373186   3.293 0.001102 ** 
## unit_idDupont Circle hd                -0.7227913  0.0606351 -11.920  < 2e-16 ***
## unit_idDupont Circle near               0.0567380  0.0756627   0.750 0.453879    
## unit_idFinancial hd                    -0.5266614  0.3010446  -1.749 0.081175 .  
## unit_idFinancial near                   0.3161568  0.3043992   1.039 0.299765    
## unit_idFoggy Bottom hd                 -0.9019682  0.1164988  -7.742 1.30e-13 ***
## unit_idFoggy Bottom near               -0.0160370  0.1247433  -0.129 0.897787    
## unit_idFoxhall hd                      -0.9417620  0.1460570  -6.448 4.19e-10 ***
## unit_idFoxhall near                    -0.0433125  0.1521818  -0.285 0.776127    
## unit_idGeorgetown hd                   -0.8431531  0.0613121 -13.752  < 2e-16 ***
## unit_idGeorgetown near                 -0.0220676  0.0767423  -0.288 0.773874    
## unit_idGreater 14th St hd              -0.5160150  0.0651008  -7.926 3.82e-14 ***
## unit_idGreater 14th St near             0.4292761  0.0810082   5.299 2.17e-07 ***
## unit_idGreater U St hd                 -0.3216217  0.0652142  -4.932 1.31e-06 ***
## unit_idGreater U St near                0.6242113  0.0786245   7.939 3.50e-14 ***
## unit_idGWU / Old West End hd           -0.8647038  0.0919662  -9.402  < 2e-16 ***
## unit_idGWU / Old West End near          0.0123236  0.1010964   0.122 0.903055    
## unit_idKalorama Triangle hd            -0.8182200  0.0741731 -11.031  < 2e-16 ***
## unit_idKalorama Triangle near           0.1469550  0.0865277   1.698 0.090415 .  
## unit_idKingman Park hd                 -0.0634855  0.0855306  -0.742 0.458479    
## unit_idKingman Park near                0.8109396  0.0952290   8.516 6.62e-16 ***
## unit_idLafayette Square hd             -0.9273367  0.7748999  -1.197 0.232305    
## unit_idLafayette Square near           -0.0002071  0.7761808   0.000 0.999787    
## unit_idLeDroit Park hd                 -0.0923155  0.1070428  -0.862 0.389106    
## unit_idLeDroit Park near                0.7495237  0.1164361   6.437 4.46e-10 ***
## unit_idLogan Circle hd                 -0.4574839  0.1127677  -4.057 6.26e-05 ***
## unit_idLogan Circle near                0.4730711  0.1216163   3.890 0.000122 ***
## unit_idMassachusetts Ave hd            -0.8162441  0.0863312  -9.455  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.0114411  0.0976043  -0.117 0.906760    
## unit_idMeridian Hill hd                -0.5495734  0.0773332  -7.107 7.82e-12 ***
## unit_idMeridian Hill near               0.4481922  0.0878928   5.099 5.86e-07 ***
## unit_idMt. Pleasant hd                 -0.6162138  0.0630507  -9.773  < 2e-16 ***
## unit_idMt. Pleasant near                0.4206713  0.0772702   5.444 1.04e-07 ***
## unit_idMt. Vernon Square hd            -0.2748180  0.1032852  -2.661 0.008191 ** 
## unit_idMt. Vernon Square near           0.6440252  0.1121898   5.740 2.20e-08 ***
## unit_idPennsylvania Ave NHS hd         -0.6712604  0.1187853  -5.651 3.54e-08 ***
## unit_idPennsylvania Ave NHS near        0.4621766  0.1268969   3.642 0.000315 ***
## unit_idShaw hd                         -0.3696384  0.0698245  -5.294 2.23e-07 ***
## unit_idShaw near                        0.5665553  0.0825532   6.863 3.52e-11 ***
## unit_idSheridan-Kalorama hd            -0.8967717  0.0823577 -10.889  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.0167014  0.0936557  -0.178 0.858579    
## unit_idSixteenth St hd                 -0.6406513  0.0713364  -8.981  < 2e-16 ***
## unit_idSixteenth St near                0.4691993  0.0846799   5.541 6.31e-08 ***
## unit_idStrivers' Section hd            -0.5575546  0.0832340  -6.699 9.52e-11 ***
## unit_idStrivers' Section near           0.4700048  0.0944348   4.977 1.06e-06 ***
## unit_idTakoma Park hd                  -0.3571119  0.1077292  -3.315 0.001022 ** 
## unit_idTakoma Park near                 0.6329865  0.1166360   5.427 1.14e-07 ***
## unit_idWashington Heights hd           -0.6903799  0.0824803  -8.370 1.83e-15 ***
## unit_idWashington Heights near          0.2612172  0.0929495   2.810 0.005255 ** 
## unit_idWoodley Park hd                 -0.8978356  0.0880615 -10.196  < 2e-16 ***
## unit_idWoodley Park near                       NA         NA      NA       NA    
## year1970                                0.0408084  0.0237221   1.720 0.086354 .  
## year1980                                0.0225982  0.0277836   0.813 0.416617    
## year1990                               -0.0248590  0.0305804  -0.813 0.416878    
## year2000                               -0.0740731  0.0331711  -2.233 0.026238 *  
## year2010                               -0.1921284  0.0333681  -5.758 2.00e-08 ***
## year2020                               -0.2514005  0.0352352  -7.135 6.55e-12 ***
## treatment_group:desig_yet              -0.0944000  0.0275552  -3.426 0.000693 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.847 on 319 degrees of freedom
##   (36 observations deleted due to missingness)
## Multiple R-squared:  0.8813, Adjusted R-squared:  0.8557 
## F-statistic: 34.34 on 69 and 319 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##      Estimate    Std. Error       t value      Pr(>|t|) 
## -0.0943999962  0.0275551783 -3.4258532167  0.0006930751 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.38532 -0.08937  0.00332  0.08878  0.44856 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.860255   0.055495  15.501  < 2e-16 ***
## treatment_group                        -0.850314   0.078768 -10.795  < 2e-16 ***
## desig_yet                               0.026267   0.029045   0.904 0.366454    
## unit_idAnacostia near                  -0.734754   0.073317 -10.022  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.318963   0.079286   4.023 7.10e-05 ***
## unit_idBlagden Alley/Naylor Court near -0.586268   0.072845  -8.048 1.44e-14 ***
## unit_idBloomingdale hd                  0.163785   0.078168   2.095 0.036889 *  
## unit_idBloomingdale near               -0.682258   0.073317  -9.306  < 2e-16 ***
## unit_idCapitol Hill hd                  0.545474   0.075933   7.184 4.36e-12 ***
## unit_idCapitol Hill near               -0.584508   0.073317  -7.972 2.42e-14 ***
## unit_idCleveland Park hd                0.834168   0.076153  10.954  < 2e-16 ***
## unit_idCleveland Park near              0.024695   0.072964   0.338 0.735226    
## unit_idDowntown hd                      0.360338   0.080035   4.502 9.27e-06 ***
## unit_idDowntown near                   -0.549878   0.072964  -7.536 4.47e-13 ***
## unit_idDupont Circle hd                 0.667532   0.075933   8.791  < 2e-16 ***
## unit_idDupont Circle near              -0.095833   0.073317  -1.307 0.192062    
## unit_idFinancial hd                     0.807938   0.082808   9.757  < 2e-16 ***
## unit_idFinancial near                  -0.385606   0.076055  -5.070 6.57e-07 ***
## unit_idFoggy Bottom hd                  0.803489   0.078834  10.192  < 2e-16 ***
## unit_idFoggy Bottom near               -0.034287   0.072964  -0.470 0.638720    
## unit_idFoxhall hd                       0.906274   0.080035  11.323  < 2e-16 ***
## unit_idFoxhall near                     0.054356   0.072964   0.745 0.456806    
## unit_idGeorgetown hd                    0.831505   0.075943  10.949  < 2e-16 ***
## unit_idGeorgetown near                  0.030040   0.073901   0.406 0.684644    
## unit_idGreater 14th St hd               0.465262   0.076602   6.074 3.36e-09 ***
## unit_idGreater 14th St near            -0.465569   0.075898  -6.134 2.39e-09 ***
## unit_idGreater U St hd                  0.270582   0.076602   3.532 0.000469 ***
## unit_idGreater U St near               -0.656012   0.072845  -9.006  < 2e-16 ***
## unit_idGWU / Old West End hd            0.836194   0.081072  10.314  < 2e-16 ***
## unit_idGWU / Old West End near         -0.019487   0.073317  -0.266 0.790560    
## unit_idKalorama Triangle hd             0.782165   0.076153  10.271  < 2e-16 ***
## unit_idKalorama Triangle near          -0.231866   0.072964  -3.178 0.001621 ** 
## unit_idKingman Park hd                  0.067825   0.081072   0.837 0.403408    
## unit_idKingman Park near               -0.762021   0.073317 -10.394  < 2e-16 ***
## unit_idLafayette Square hd              0.850294   0.088128   9.648  < 2e-16 ***
## unit_idLafayette Square near           -0.125451   0.073317  -1.711 0.087983 .  
## unit_idLeDroit Park hd                  0.102746   0.078682   1.306 0.192495    
## unit_idLeDroit Park near               -0.718590   0.073317  -9.801  < 2e-16 ***
## unit_idLogan Circle hd                  0.425396   0.078682   5.407 1.22e-07 ***
## unit_idLogan Circle near               -0.494764   0.076519  -6.466 3.53e-10 ***
## unit_idMassachusetts Ave hd             0.737149   0.078682   9.369  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.017136   0.073317  -0.234 0.815340    
## unit_idMeridian Hill hd                 0.426958   0.081072   5.266 2.48e-07 ***
## unit_idMeridian Hill near              -0.532487   0.073317  -7.263 2.63e-12 ***
## unit_idMt. Pleasant hd                  0.473754   0.076153   6.221 1.46e-09 ***
## unit_idMt. Pleasant near               -0.505429   0.072964  -6.927 2.18e-11 ***
## unit_idMt. Vernon Square hd             0.227043   0.079286   2.864 0.004450 ** 
## unit_idMt. Vernon Square near          -0.677242   0.072845  -9.297  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd          0.506969   0.076602   6.618 1.43e-10 ***
## unit_idPennsylvania Ave NHS near       -0.522799   0.072845  -7.177 4.55e-12 ***
## unit_idShaw hd                          0.261716   0.076602   3.417 0.000712 ***
## unit_idShaw near                       -0.598434   0.072845  -8.215 4.56e-15 ***
## unit_idSheridan-Kalorama hd             0.837063   0.076153  10.992  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.006861   0.072964  -0.094 0.925134    
## unit_idSixteenth St hd                  0.561849   0.078682   7.141 5.72e-12 ***
## unit_idSixteenth St near               -0.553873   0.073317  -7.555 3.97e-13 ***
## unit_idStrivers' Section hd             0.510769   0.078834   6.479 3.26e-10 ***
## unit_idStrivers' Section near          -0.548633   0.076055  -7.214 3.60e-12 ***
## unit_idTakoma Park hd                   0.322677   0.078834   4.093 5.33e-05 ***
## unit_idTakoma Park near                -0.556148   0.072964  -7.622 2.54e-13 ***
## unit_idWashington Heights hd            0.629939   0.080035   7.871 4.82e-14 ***
## unit_idWashington Heights near         -0.274709   0.072964  -3.765 0.000196 ***
## unit_idWoodley Park hd                  0.829151   0.079286  10.458  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.053767   0.028563  -1.882 0.060638 .  
## year1980                               -0.093252   0.029473  -3.164 0.001698 ** 
## year1990                               -0.081173   0.031697  -2.561 0.010874 *  
## year2000                               -0.074488   0.034625  -2.151 0.032160 *  
## year2010                                0.026817   0.036037   0.744 0.457302    
## year2020                               -0.012111   0.037989  -0.319 0.750078    
## treatment_group:desig_yet               0.078499   0.030077   2.610 0.009458 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1363 on 338 degrees of freedom
##   (20 observations deleted due to missingness)
## Multiple R-squared:  0.8392, Adjusted R-squared:  0.8064 
## F-statistic: 25.57 on 69 and 338 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## 0.078499390 0.030076739 2.609970138 0.009457861 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.929  -4.348   0.000   4.068  43.331 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.803633   0.070504  11.398  < 2e-16 ***
## treatment_group                        -0.837547   0.087089  -9.617  < 2e-16 ***
## desig_yet                               0.037069   0.027539   1.346 0.179237    
## unit_idAnacostia near                  -0.778331   0.085598  -9.093  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.274646   0.153658   1.787 0.074825 .  
## unit_idBlagden Alley/Naylor Court near -0.531284   0.159487  -3.331 0.000966 ***
## unit_idBloomingdale hd                  0.156522   0.067732   2.311 0.021475 *  
## unit_idBloomingdale near               -0.652829   0.079310  -8.231 4.79e-15 ***
## unit_idCapitol Hill hd                  0.505847   0.055651   9.090  < 2e-16 ***
## unit_idCapitol Hill near               -0.578600   0.070926  -8.158 7.94e-15 ***
## unit_idCleveland Park hd                0.808416   0.068894  11.734  < 2e-16 ***
## unit_idCleveland Park near              0.028593   0.081445   0.351 0.725769    
## unit_idDowntown hd                      0.368989   0.126700   2.912 0.003841 ** 
## unit_idDowntown near                   -0.492880   0.133482  -3.692 0.000261 ***
## unit_idDupont Circle hd                 0.641713   0.058941  10.887  < 2e-16 ***
## unit_idDupont Circle near              -0.080443   0.073549  -1.094 0.274896    
## unit_idFinancial hd                     0.447114   0.292635   1.528 0.127531    
## unit_idFinancial near                  -0.343512   0.295896  -1.161 0.246541    
## unit_idFoggy Bottom hd                  0.812772   0.113244   7.177 5.02e-12 ***
## unit_idFoggy Bottom near               -0.001131   0.121259  -0.009 0.992565    
## unit_idFoxhall hd                       0.889303   0.141977   6.264 1.21e-09 ***
## unit_idFoxhall near                     0.048546   0.147931   0.328 0.743001    
## unit_idGeorgetown hd                    0.794492   0.059599  13.331  < 2e-16 ***
## unit_idGeorgetown near                  0.029975   0.074598   0.402 0.688085    
## unit_idGreater 14th St hd               0.441709   0.063282   6.980 1.72e-11 ***
## unit_idGreater 14th St near            -0.445978   0.078745  -5.664 3.31e-08 ***
## unit_idGreater U St hd                  0.254196   0.063392   4.010 7.57e-05 ***
## unit_idGreater U St near               -0.639060   0.076428  -8.362 1.95e-15 ***
## unit_idGWU / Old West End hd            0.774228   0.089397   8.661 2.38e-16 ***
## unit_idGWU / Old West End near         -0.055566   0.098272  -0.565 0.572177    
## unit_idKalorama Triangle hd             0.754647   0.072101  10.467  < 2e-16 ***
## unit_idKalorama Triangle near          -0.181361   0.084110  -2.156 0.031814 *  
## unit_idKingman Park hd                  0.062948   0.083141   0.757 0.449539    
## unit_idKingman Park near               -0.749447   0.092569  -8.096 1.21e-14 ***
## unit_idLafayette Square hd              0.835648   0.753253   1.109 0.268099    
## unit_idLafayette Square near           -0.025340   0.754498  -0.034 0.973229    
## unit_idLeDroit Park hd                  0.066575   0.104053   0.640 0.522750    
## unit_idLeDroit Park near               -0.704717   0.113183  -6.226 1.50e-09 ***
## unit_idLogan Circle hd                  0.395587   0.109617   3.609 0.000357 ***
## unit_idLogan Circle near               -0.482349   0.118219  -4.080 5.69e-05 ***
## unit_idMassachusetts Ave hd             0.722407   0.083920   8.608 3.44e-16 ***
## unit_idMassachusetts Ave near           0.003751   0.094878   0.040 0.968486    
## unit_idMeridian Hill hd                 0.423307   0.075173   5.631 3.93e-08 ***
## unit_idMeridian Hill near              -0.528096   0.085437  -6.181 1.94e-09 ***
## unit_idMt. Pleasant hd                  0.462910   0.061289   7.553 4.53e-13 ***
## unit_idMt. Pleasant near               -0.491010   0.075112  -6.537 2.49e-10 ***
## unit_idMt. Vernon Square hd             0.212356   0.100400   2.115 0.035196 *  
## unit_idMt. Vernon Square near          -0.637132   0.109056  -5.842 1.27e-08 ***
## unit_idPennsylvania Ave NHS hd          0.557249   0.115467   4.826 2.16e-06 ***
## unit_idPennsylvania Ave NHS near       -0.492753   0.123352  -3.995 8.05e-05 ***
## unit_idShaw hd                          0.237957   0.067874   3.506 0.000520 ***
## unit_idShaw near                       -0.585728   0.080247  -7.299 2.32e-12 ***
## unit_idSheridan-Kalorama hd             0.827629   0.080057  10.338  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.006970   0.091039   0.077 0.939023    
## unit_idSixteenth St hd                  0.530117   0.069344   7.645 2.48e-13 ***
## unit_idSixteenth St near               -0.521283   0.082314  -6.333 8.17e-10 ***
## unit_idStrivers' Section hd             0.470041   0.080909   5.810 1.52e-08 ***
## unit_idStrivers' Section near          -0.548932   0.091797  -5.980 5.98e-09 ***
## unit_idTakoma Park hd                   0.299477   0.104720   2.860 0.004519 ** 
## unit_idTakoma Park near                -0.630946   0.113378  -5.565 5.56e-08 ***
## unit_idWashington Heights hd            0.606835   0.080176   7.569 4.08e-13 ***
## unit_idWashington Heights near         -0.317317   0.090353  -3.512 0.000509 ***
## unit_idWoodley Park hd                  0.820332   0.085601   9.583  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.045645   0.023059  -1.979 0.048623 *  
## year1980                               -0.054604   0.027007  -2.022 0.044031 *  
## year1990                               -0.032903   0.029726  -1.107 0.269178    
## year2000                               -0.034724   0.032244  -1.077 0.282333    
## year2010                                0.085062   0.032436   2.622 0.009148 ** 
## year2020                                0.061338   0.034251   1.791 0.074266 .  
## treatment_group:desig_yet               0.105289   0.026785   3.931 0.000104 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.6 on 319 degrees of freedom
##   (36 observations deleted due to missingness)
## Multiple R-squared:  0.861,  Adjusted R-squared:  0.831 
## F-statistic: 28.64 on 69 and 319 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##     Estimate   Std. Error      t value     Pr(>|t|) 
## 0.1052893120 0.0267854055 3.9308462906 0.0001038463
## 
## Call:
## did::att_gt(yname = "percent", tname = "year", idname = "unit_id_num", 
##     gname = "first_decade_desig", xformla = ~1, data = comp_df[comp_df$group == 
##         "black" & !is.na(comp_df$n_tot_hd), ], allow_unbalanced_panel = T, 
##     weightsname = "n_tot_hd")
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## Group-Time Average Treatment Effects:
##  Group Time ATT(g,t) Std. Error [95% Simult.  Conf. Band]  
##   1970 1970  -0.0984     0.0636       -0.2564      0.0597  
##   1970 1980  -0.0590     0.0645       -0.2191      0.1012  
##   1970 1990   0.0255     0.0619       -0.1282      0.1793  
##   1970 2000   0.0899     0.0548       -0.0461      0.2259  
##   1970 2010   0.2333     0.0952       -0.0033      0.4698  
##   1970 2020   0.3234     0.1270        0.0079      0.6388 *
##   1980 1970  -0.0813     0.0753       -0.2684      0.1058  
##   1980 1980  -0.1132     0.0848       -0.3239      0.0976  
##   1980 1990  -0.1480     0.0936       -0.3805      0.0846  
##   1980 2000  -0.1244     0.0840       -0.3331      0.0844  
##   1980 2010  -0.0572     0.1041       -0.3158      0.2014  
##   1980 2020  -0.0126     0.1122       -0.2914      0.2661  
##   1990 1970   0.1076     0.1449       -0.2524      0.4676  
##   1990 1980  -0.0412     0.0501       -0.1656      0.0832  
##   1990 1990  -0.0185     0.0500       -0.1427      0.1058  
##   1990 2000  -0.0051     0.0756       -0.1928      0.1827  
##   1990 2010   0.0692     0.0974       -0.1727      0.3111  
##   1990 2020   0.1414     0.1206       -0.1581      0.4409  
##   2000 1970  -0.1079     0.1176       -0.4001      0.1843  
##   2000 1980  -0.0717     0.0249       -0.1336     -0.0098 *
##   2000 1990  -0.1038     0.0455       -0.2169      0.0092  
##   2000 2000  -0.0685     0.0331       -0.1507      0.0137  
##   2000 2010  -0.1011     0.0749       -0.2872      0.0849  
##   2000 2020  -0.0644     0.0976       -0.3067      0.1780  
##   2010 1970       NA         NA            NA          NA  
##   2010 1980  -0.1392     0.0432       -0.2465     -0.0319 *
##   2010 1990  -0.0579     0.0373       -0.1506      0.0347  
##   2010 2000  -0.0150     0.0250       -0.0770      0.0469  
##   2010 2010   0.1082     0.0548       -0.0280      0.2444  
##   2010 2020   0.1792     0.0882       -0.0398      0.3982  
##   2020 1970  -0.2494     0.1371       -0.5900      0.0911  
##   2020 1980   0.0235     0.0386       -0.0723      0.1193  
##   2020 1990  -0.0173     0.0462       -0.1321      0.0974  
##   2020 2000   0.0279     0.0669       -0.1382      0.1940  
##   2020 2010  -0.0831     0.0829       -0.2889      0.1228  
##   2020 2020  -0.0691     0.0751       -0.2557      0.1176  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## P-value for pre-test of parallel trends assumption:  0
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
## 
## Call:
## aggte(MP = hd.attgt, type = "group", na.rm = T)
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## 
## Overall summary of ATT's based on group/cohort aggregation:  
##      ATT    Std. Error     [ 95%  Conf. Int.] 
##  -0.0365        0.0492    -0.1329      0.0599 
## 
## 
## Group Effects:
##  Group Estimate Std. Error [95% Simult.  Conf. Band] 
##   1970   0.0858     0.0788       -0.0823      0.2538 
##   1980  -0.0911     0.0865       -0.2756      0.0934 
##   1990   0.0468     0.0726       -0.1082      0.2017 
##   2000  -0.0780     0.0625       -0.2113      0.0553 
##   2010   0.1437     0.0684       -0.0023      0.2898 
##   2020  -0.0691     0.0706       -0.2198      0.0817 
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
plot_ly(
    data = comp_df[comp_df$group=="black",] %>% arrange(LABEL, year_index),
    x = ~year_index,
    y = ~percent,  # ~percent_std
    color = ~LABEL,  # Specify the grouping variable for color
    linetype = ~as.factor(treatment_control),
    type = "scatter",
    mode = "lines+markers"
  )

Robustness checks

run_all(mp=.25, buff_dist=.008, threshold=.1)
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.43702 -0.08614  0.00036  0.08770  0.37683 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.130954   0.055673   2.352 0.019229 *  
## treatment_group                         0.904595   0.079554  11.371  < 2e-16 ***
## desig_yet                              -0.028332   0.029238  -0.969 0.333223    
## unit_idAnacostia near                   0.754106   0.074047  10.184  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.484857   0.080079  -6.055 3.70e-09 ***
## unit_idBlagden Alley/Naylor Court near  0.561594   0.073574   7.633 2.31e-13 ***
## unit_idBloomingdale hd                 -0.189712   0.078948  -2.403 0.016793 *  
## unit_idBloomingdale near                0.705664   0.074047   9.530  < 2e-16 ***
## unit_idCapitol Hill hd                 -0.577782   0.076687  -7.534 4.43e-13 ***
## unit_idCapitol Hill near                0.643623   0.074047   8.692  < 2e-16 ***
## unit_idCleveland Park hd               -0.899597   0.076911 -11.697  < 2e-16 ***
## unit_idCleveland Park near             -0.032483   0.073692  -0.441 0.659638    
## unit_idDowntown hd                     -0.779352   0.080834  -9.641  < 2e-16 ***
## unit_idDowntown near                    0.542911   0.073692   7.367 1.32e-12 ***
## unit_idDupont Circle hd                -0.758383   0.076687  -9.889  < 2e-16 ***
## unit_idDupont Circle near               0.223165   0.074047   3.014 0.002772 ** 
## unit_idFinancial hd                    -0.856920   0.083636 -10.246  < 2e-16 ***
## unit_idFinancial near                   0.225621   0.073692   3.062 0.002376 ** 
## unit_idFoggy Bottom hd                 -0.907053   0.079622 -11.392  < 2e-16 ***
## unit_idFoggy Bottom near               -0.006952   0.073692  -0.094 0.924896    
## unit_idFoxhall hd                      -0.962704   0.080834 -11.910  < 2e-16 ***
## unit_idFoxhall near                    -0.060179   0.073692  -0.817 0.414711    
## unit_idGeorgetown hd                   -0.889617   0.076696 -11.599  < 2e-16 ***
## unit_idGeorgetown near                 -0.032530   0.074633  -0.436 0.663207    
## unit_idGreater 14th St hd              -0.547058   0.077366  -7.071 8.71e-12 ***
## unit_idGreater 14th St near             0.545985   0.073574   7.421 9.30e-13 ***
## unit_idGreater U St hd                 -0.344968   0.077366  -4.459 1.12e-05 ***
## unit_idGreater U St near                0.569089   0.073574   7.735 1.17e-13 ***
## unit_idGWU / Old West End hd           -0.935682   0.081880 -11.428  < 2e-16 ***
## unit_idGWU / Old West End near         -0.016997   0.074047  -0.230 0.818582    
## unit_idKalorama Triangle hd            -0.851450   0.076911 -11.071  < 2e-16 ***
## unit_idKalorama Triangle near           0.276043   0.073692   3.746 0.000211 ***
## unit_idKingman Park hd                 -0.066116   0.081880  -0.807 0.419956    
## unit_idKingman Park near                0.778580   0.074047  10.515  < 2e-16 ***
## unit_idLafayette Square hd             -0.929211   0.089009 -10.439  < 2e-16 ***
## unit_idLafayette Square near            0.153464   0.074047   2.073 0.038965 *  
## unit_idLeDroit Park hd                 -0.140559   0.079469  -1.769 0.077831 .  
## unit_idLeDroit Park near                0.722697   0.074047   9.760  < 2e-16 ***
## unit_idLogan Circle hd                 -0.497631   0.079469  -6.262 1.14e-09 ***
## unit_idLogan Circle near                0.609851   0.074047   8.236 3.82e-15 ***
## unit_idMassachusetts Ave hd            -0.841631   0.079469 -10.591  < 2e-16 ***
## unit_idMassachusetts Ave near           0.005527   0.074047   0.075 0.940547    
## unit_idMeridian Hill hd                -0.557586   0.081880  -6.810 4.41e-11 ***
## unit_idMeridian Hill near               0.478798   0.074047   6.466 3.47e-10 ***
## unit_idMt. Pleasant hd                 -0.629835   0.076911  -8.189 5.29e-15 ***
## unit_idMt. Pleasant near                0.449820   0.073692   6.104 2.81e-09 ***
## unit_idMt. Vernon Square hd            -0.298529   0.080079  -3.728 0.000226 ***
## unit_idMt. Vernon Square near           0.637783   0.073574   8.669  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd         -0.600233   0.077366  -7.758 1.00e-13 ***
## unit_idPennsylvania Ave NHS near        0.479021   0.073574   6.511 2.67e-10 ***
## unit_idShaw hd                         -0.400661   0.077366  -5.179 3.82e-07 ***
## unit_idShaw near                        0.607332   0.073574   8.255 3.35e-15 ***
## unit_idSheridan-Kalorama hd            -0.911811   0.076911 -11.855  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.056313   0.073692   0.764 0.445300    
## unit_idSixteenth St hd                 -0.682972   0.079469  -8.594 3.04e-16 ***
## unit_idSixteenth St near                0.383790   0.074047   5.183 3.74e-07 ***
## unit_idStrivers' Section hd            -0.606513   0.079622  -7.617 2.56e-13 ***
## unit_idStrivers' Section near           0.410598   0.073692   5.572 5.12e-08 ***
## unit_idTakoma Park hd                  -0.386748   0.079622  -4.857 1.81e-06 ***
## unit_idTakoma Park near                 0.574982   0.073692   7.802 7.45e-14 ***
## unit_idWashington Heights hd           -0.719322   0.080834  -8.899  < 2e-16 ***
## unit_idWashington Heights near          0.325445   0.073692   4.416 1.35e-05 ***
## unit_idWoodley Park hd                 -0.912670   0.080079 -11.397  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                                0.068192   0.028003   2.435 0.015394 *  
## year1980                                0.073171   0.028983   2.525 0.012034 *  
## year1990                                0.035520   0.031315   1.134 0.257479    
## year2000                               -0.032275   0.034355  -0.939 0.348167    
## year2010                               -0.135868   0.035813  -3.794 0.000175 ***
## year2020                               -0.189102   0.037824  -5.000 9.20e-07 ***
## treatment_group:desig_yet              -0.069194   0.030248  -2.288 0.022775 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1376 on 342 degrees of freedom
##   (22 observations deleted due to missingness)
## Multiple R-squared:  0.8552, Adjusted R-squared:  0.826 
## F-statistic: 29.27 on 69 and 342 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## -0.06919379  0.03024819 -2.28753498  0.02277468 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -35.622  -4.894   0.131   4.375  24.640 
## 
## Coefficients: (1 not defined because of singularities)
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.18360    0.07030   2.612 0.009431 ** 
## treatment_group                         0.89715    0.08701  10.311  < 2e-16 ***
## desig_yet                              -0.04779    0.02752  -1.736 0.083457 .  
## unit_idAnacostia near                   0.77069    0.08554   9.009  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.43776    0.15356  -2.851 0.004644 ** 
## unit_idBlagden Alley/Naylor Court near  0.51103    0.15938   3.206 0.001480 ** 
## unit_idBloomingdale hd                 -0.18384    0.06769  -2.716 0.006964 ** 
## unit_idBloomingdale near                0.68458    0.07925   8.638 2.76e-16 ***
## unit_idCapitol Hill hd                 -0.53393    0.05561  -9.601  < 2e-16 ***
## unit_idCapitol Hill near                0.64026    0.07087   9.034  < 2e-16 ***
## unit_idCleveland Park hd               -0.86518    0.06885 -12.566  < 2e-16 ***
## unit_idCleveland Park near             -0.02392    0.08139  -0.294 0.769055    
## unit_idDowntown hd                     -0.71361    0.12662  -5.636 3.82e-08 ***
## unit_idDowntown near                    0.49439    0.13339   3.706 0.000248 ***
## unit_idDupont Circle hd                -0.72172    0.05890 -12.254  < 2e-16 ***
## unit_idDupont Circle near               0.22836    0.07349   3.107 0.002058 ** 
## unit_idFinancial hd                    -0.52385    0.29244  -1.791 0.074194 .  
## unit_idFinancial near                   0.29710    0.29570   1.005 0.315782    
## unit_idFoggy Bottom hd                 -0.90187    0.11317  -7.969 2.84e-14 ***
## unit_idFoggy Bottom near               -0.03097    0.12118  -0.256 0.798419    
## unit_idFoxhall hd                      -0.94054    0.14188  -6.629 1.44e-10 ***
## unit_idFoxhall near                    -0.04452    0.14783  -0.301 0.763507    
## unit_idGeorgetown hd                   -0.84266    0.05956 -14.149  < 2e-16 ***
## unit_idGeorgetown near                 -0.01796    0.07455  -0.241 0.809821    
## unit_idGreater 14th St hd              -0.51439    0.06324  -8.134 9.27e-15 ***
## unit_idGreater 14th St near             0.53698    0.07631   7.037 1.20e-11 ***
## unit_idGreater U St hd                 -0.31992    0.06335  -5.050 7.44e-07 ***
## unit_idGreater U St near                0.55739    0.07637   7.298 2.32e-12 ***
## unit_idGWU / Old West End hd           -0.86287    0.08933  -9.660  < 2e-16 ***
## unit_idGWU / Old West End near          0.01177    0.09821   0.120 0.904705    
## unit_idKalorama Triangle hd            -0.81683    0.07205 -11.337  < 2e-16 ***
## unit_idKalorama Triangle near           0.24975    0.08405   2.971 0.003188 ** 
## unit_idKingman Park hd                 -0.06208    0.08307  -0.747 0.455442    
## unit_idKingman Park near                0.78696    0.09251   8.507 6.97e-16 ***
## unit_idLafayette Square hd             -0.92561    0.75276  -1.230 0.219741    
## unit_idLafayette Square near            0.07563    0.75400   0.100 0.920168    
## unit_idLeDroit Park hd                 -0.09214    0.10398  -0.886 0.376223    
## unit_idLeDroit Park near                0.74653    0.11311   6.600 1.71e-10 ***
## unit_idLogan Circle hd                 -0.45716    0.10955  -4.173 3.87e-05 ***
## unit_idLogan Circle near                0.57230    0.11814   4.844 1.98e-06 ***
## unit_idMassachusetts Ave hd            -0.81598    0.08386  -9.730  < 2e-16 ***
## unit_idMassachusetts Ave near           0.02013    0.09482   0.212 0.831988    
## unit_idMeridian Hill hd                -0.54815    0.07511  -7.298 2.32e-12 ***
## unit_idMeridian Hill near               0.46685    0.08538   5.468 9.19e-08 ***
## unit_idMt. Pleasant hd                 -0.61512    0.06125 -10.043  < 2e-16 ***
## unit_idMt. Pleasant near                0.44667    0.07506   5.951 7.00e-09 ***
## unit_idMt. Vernon Square hd            -0.27353    0.10033  -2.726 0.006759 ** 
## unit_idMt. Vernon Square near           0.60314    0.10898   5.534 6.52e-08 ***
## unit_idPennsylvania Ave NHS hd         -0.66901    0.11539  -5.798 1.61e-08 ***
## unit_idPennsylvania Ave NHS near        0.47334    0.12327   3.840 0.000148 ***
## unit_idShaw hd                         -0.36785    0.06783  -5.423 1.16e-07 ***
## unit_idShaw near                        0.60256    0.08019   7.514 5.78e-13 ***
## unit_idSheridan-Kalorama hd            -0.89571    0.08000 -11.196  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.05266    0.09098   0.579 0.563118    
## unit_idSixteenth St hd                 -0.64032    0.06930  -9.240  < 2e-16 ***
## unit_idSixteenth St near                0.40675    0.08226   4.945 1.23e-06 ***
## unit_idStrivers' Section hd            -0.55706    0.08086  -6.890 2.98e-11 ***
## unit_idStrivers' Section near           0.44402    0.09174   4.840 2.02e-06 ***
## unit_idTakoma Park hd                  -0.35605    0.10465  -3.402 0.000753 ***
## unit_idTakoma Park near                 0.65176    0.11330   5.752 2.06e-08 ***
## unit_idWashington Heights hd           -0.68913    0.08012  -8.602 3.57e-16 ***
## unit_idWashington Heights near          0.36718    0.09029   4.066 6.01e-05 ***
## unit_idWoodley Park hd                 -0.89700    0.08554 -10.486  < 2e-16 ***
## unit_idWoodley Park near                     NA         NA      NA       NA    
## year1970                                0.04428    0.02268   1.953 0.051738 .  
## year1980                                0.02607    0.02661   0.980 0.327968    
## year1990                               -0.01916    0.02932  -0.654 0.513853    
## year2000                               -0.07563    0.03183  -2.376 0.018084 *  
## year2010                               -0.18645    0.03201  -5.825 1.39e-08 ***
## year2020                               -0.25712    0.03382  -7.602 3.26e-13 ***
## treatment_group:desig_yet              -0.09704    0.02666  -3.640 0.000318 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.595 on 320 degrees of freedom
##   (41 observations deleted due to missingness)
## Multiple R-squared:  0.883,  Adjusted R-squared:  0.8578 
## F-statistic:    35 on 69 and 320 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##      Estimate    Std. Error       t value      Pr(>|t|) 
## -0.0970439483  0.0266608092 -3.6399475984  0.0003178643 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.39411 -0.07380 -0.00092  0.07899  0.42352 
## 
## Coefficients: (1 not defined because of singularities)
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.86398    0.05300  16.302  < 2e-16 ***
## treatment_group                        -0.83537    0.07573 -11.030  < 2e-16 ***
## desig_yet                               0.01676    0.02783   0.602 0.547378    
## unit_idAnacostia near                  -0.68442    0.07049  -9.709  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.31716    0.07623   4.160 4.02e-05 ***
## unit_idBlagden Alley/Naylor Court near -0.58184    0.07004  -8.307 2.32e-15 ***
## unit_idBloomingdale hd                  0.15803    0.07516   2.103 0.036230 *  
## unit_idBloomingdale near               -0.67409    0.07049  -9.563  < 2e-16 ***
## unit_idCapitol Hill hd                  0.54281    0.07300   7.435 8.47e-13 ***
## unit_idCapitol Hill near               -0.59787    0.07049  -8.482 6.78e-16 ***
## unit_idCleveland Park hd                0.83073    0.07322  11.346  < 2e-16 ***
## unit_idCleveland Park near              0.03581    0.07015   0.510 0.610062    
## unit_idDowntown hd                      0.35763    0.07695   4.647 4.80e-06 ***
## unit_idDowntown near                   -0.56078    0.07015  -7.994 2.04e-14 ***
## unit_idDupont Circle hd                 0.66487    0.07300   9.107  < 2e-16 ***
## unit_idDupont Circle near              -0.26439    0.07049  -3.751 0.000207 ***
## unit_idFinancial hd                     0.80731    0.07962  10.140  < 2e-16 ***
## unit_idFinancial near                  -0.26423    0.07015  -3.766 0.000195 ***
## unit_idFoggy Bottom hd                  0.80259    0.07580  10.588  < 2e-16 ***
## unit_idFoggy Bottom near               -0.01773    0.07015  -0.253 0.800639    
## unit_idFoxhall hd                       0.90357    0.07695  11.742  < 2e-16 ***
## unit_idFoxhall near                     0.06438    0.07015   0.918 0.359403    
## unit_idGeorgetown hd                    0.82961    0.07301  11.362  < 2e-16 ***
## unit_idGeorgetown near                  0.03132    0.07105   0.441 0.659579    
## unit_idGreater 14th St hd               0.46105    0.07365   6.260 1.15e-09 ***
## unit_idGreater 14th St near            -0.56709    0.07004  -8.097 1.00e-14 ***
## unit_idGreater U St hd                  0.26637    0.07365   3.617 0.000343 ***
## unit_idGreater U St near               -0.59188    0.07004  -8.450 8.46e-16 ***
## unit_idGWU / Old West End hd            0.83259    0.07795  10.681  < 2e-16 ***
## unit_idGWU / Old West End near         -0.01306    0.07049  -0.185 0.853148    
## unit_idKalorama Triangle hd             0.77873    0.07322  10.636  < 2e-16 ***
## unit_idKalorama Triangle near          -0.32233    0.07015  -4.595 6.11e-06 ***
## unit_idKingman Park hd                  0.06422    0.07795   0.824 0.410605    
## unit_idKingman Park near               -0.72200    0.07049 -10.242  < 2e-16 ***
## unit_idLafayette Square hd              0.85110    0.08474  10.044  < 2e-16 ***
## unit_idLafayette Square near           -0.19470    0.07049  -2.762 0.006054 ** 
## unit_idLeDroit Park hd                  0.10275    0.07565   1.358 0.175319    
## unit_idLeDroit Park near               -0.69133    0.07049  -9.807  < 2e-16 ***
## unit_idLogan Circle hd                  0.42540    0.07565   5.623 3.90e-08 ***
## unit_idLogan Circle near               -0.61218    0.07049  -8.685  < 2e-16 ***
## unit_idMassachusetts Ave hd             0.73715    0.07565   9.744  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.01113    0.07049  -0.158 0.874583    
## unit_idMeridian Hill hd                 0.42335    0.07795   5.431 1.06e-07 ***
## unit_idMeridian Hill near              -0.54901    0.07049  -7.788 8.18e-14 ***
## unit_idMt. Pleasant hd                  0.47031    0.07322   6.423 4.46e-10 ***
## unit_idMt. Pleasant near               -0.50818    0.07015  -7.244 2.91e-12 ***
## unit_idMt. Vernon Square hd             0.22524    0.07623   2.955 0.003348 ** 
## unit_idMt. Vernon Square near          -0.63222    0.07004  -9.026  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd          0.50276    0.07365   6.826 3.98e-11 ***
## unit_idPennsylvania Ave NHS near       -0.49146    0.07004  -7.017 1.22e-11 ***
## unit_idShaw hd                          0.25750    0.07365   3.496 0.000534 ***
## unit_idShaw near                       -0.61254    0.07004  -8.745  < 2e-16 ***
## unit_idSheridan-Kalorama hd             0.83362    0.07322  11.386  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.08277    0.07015  -1.180 0.238878    
## unit_idSixteenth St hd                  0.56185    0.07565   7.427 8.95e-13 ***
## unit_idSixteenth St near               -0.43234    0.07049  -6.133 2.38e-09 ***
## unit_idStrivers' Section hd             0.50987    0.07580   6.727 7.31e-11 ***
## unit_idStrivers' Section near          -0.46776    0.07015  -6.668 1.04e-10 ***
## unit_idTakoma Park hd                   0.32178    0.07580   4.245 2.82e-05 ***
## unit_idTakoma Park near                -0.56555    0.07015  -8.062 1.28e-14 ***
## unit_idWashington Heights hd            0.62723    0.07695   8.151 6.90e-15 ***
## unit_idWashington Heights near         -0.40080    0.07015  -5.713 2.41e-08 ***
## unit_idWoodley Park hd                  0.82735    0.07623  10.853  < 2e-16 ***
## unit_idWoodley Park near                     NA         NA      NA       NA    
## year1970                               -0.07449    0.02666  -2.794 0.005496 ** 
## year1980                               -0.11199    0.02759  -4.059 6.11e-05 ***
## year1990                               -0.09808    0.02981  -3.290 0.001106 ** 
## year2000                               -0.08544    0.03271  -2.613 0.009384 ** 
## year2010                                0.01449    0.03409   0.425 0.671199    
## year2020                               -0.01738    0.03601  -0.483 0.629643    
## treatment_group:desig_yet               0.08259    0.02880   2.868 0.004386 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.131 on 342 degrees of freedom
##   (22 observations deleted due to missingness)
## Multiple R-squared:  0.8436, Adjusted R-squared:  0.812 
## F-statistic: 26.74 on 69 and 342 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## 0.082589468 0.028795701 2.868118004 0.004385506 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -27.569  -3.739  -0.198   4.046  38.636 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.810414   0.067624  11.984  < 2e-16 ***
## treatment_group                        -0.839760   0.083704 -10.033  < 2e-16 ***
## desig_yet                               0.032434   0.026474   1.225 0.221438    
## unit_idAnacostia near                  -0.702901   0.082290  -8.542 5.46e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.274959   0.147717   1.861 0.063607 .  
## unit_idBlagden Alley/Naylor Court near -0.535105   0.153322  -3.490 0.000551 ***
## unit_idBloomingdale hd                  0.156785   0.065112   2.408 0.016609 *  
## unit_idBloomingdale near               -0.658859   0.076238  -8.642 2.68e-16 ***
## unit_idCapitol Hill hd                  0.504782   0.053497   9.436  < 2e-16 ***
## unit_idCapitol Hill near               -0.600645   0.068177  -8.810  < 2e-16 ***
## unit_idCleveland Park hd                0.807961   0.066231  12.199  < 2e-16 ***
## unit_idCleveland Park near              0.027514   0.078294   0.351 0.725505    
## unit_idDowntown hd                      0.369715   0.121801   3.035 0.002599 ** 
## unit_idDowntown near                   -0.516528   0.128323  -4.025 7.11e-05 ***
## unit_idDupont Circle hd                 0.640634   0.056659  11.307  < 2e-16 ***
## unit_idDupont Circle near              -0.265878   0.070699  -3.761 0.000201 ***
## unit_idFinancial hd                     0.445037   0.281323   1.582 0.114651    
## unit_idFinancial near                  -0.323310   0.284458  -1.137 0.256564    
## unit_idFoggy Bottom hd                  0.813632   0.108866   7.474 7.52e-13 ***
## unit_idFoggy Bottom near                0.008263   0.116572   0.071 0.943533    
## unit_idFoxhall hd                       0.890715   0.136485   6.526 2.64e-10 ***
## unit_idFoxhall near                     0.049093   0.142213   0.345 0.730165    
## unit_idGeorgetown hd                    0.793503   0.057291  13.850  < 2e-16 ***
## unit_idGeorgetown near                  0.017173   0.071713   0.239 0.810898    
## unit_idGreater 14th St hd               0.441125   0.060836   7.251 3.13e-12 ***
## unit_idGreater 14th St near            -0.556721   0.073407  -7.584 3.67e-13 ***
## unit_idGreater U St hd                  0.253627   0.060942   4.162 4.06e-05 ***
## unit_idGreater U St near               -0.578522   0.073469  -7.874 5.37e-14 ***
## unit_idGWU / Old West End hd            0.775550   0.085932   9.025  < 2e-16 ***
## unit_idGWU / Old West End near         -0.053289   0.094474  -0.564 0.573106    
## unit_idKalorama Triangle hd             0.753772   0.069312  10.875  < 2e-16 ***
## unit_idKalorama Triangle near          -0.291012   0.080851  -3.599 0.000370 ***
## unit_idKingman Park hd                  0.064668   0.079915   0.809 0.418999    
## unit_idKingman Park near               -0.728347   0.088991  -8.185 6.55e-15 ***
## unit_idLafayette Square hd              0.834394   0.724137   1.152 0.250074    
## unit_idLafayette Square near           -0.113525   0.725334  -0.157 0.875727    
## unit_idLeDroit Park hd                  0.066575   0.100030   0.666 0.506177    
## unit_idLeDroit Park near               -0.707019   0.108808  -6.498 3.12e-10 ***
## unit_idLogan Circle hd                  0.395565   0.105380   3.754 0.000207 ***
## unit_idLogan Circle near               -0.575934   0.113649  -5.068 6.82e-07 ***
## unit_idMassachusetts Ave hd             0.722340   0.080676   8.954  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.025750   0.091210  -0.282 0.777883    
## unit_idMeridian Hill hd                 0.425220   0.072253   5.885 1.00e-08 ***
## unit_idMeridian Hill near              -0.547883   0.082135  -6.671 1.12e-10 ***
## unit_idMt. Pleasant hd                  0.462577   0.058920   7.851 6.28e-14 ***
## unit_idMt. Pleasant near               -0.505781   0.072205  -7.005 1.47e-11 ***
## unit_idMt. Vernon Square hd             0.212688   0.096517   2.204 0.028262 *  
## unit_idMt. Vernon Square near          -0.599166   0.104840  -5.715 2.51e-08 ***
## unit_idPennsylvania Ave NHS hd          0.555632   0.111003   5.006 9.21e-07 ***
## unit_idPennsylvania Ave NHS near       -0.486020   0.118581  -4.099 5.27e-05 ***
## unit_idShaw hd                          0.237202   0.065250   3.635 0.000323 ***
## unit_idShaw near                       -0.608754   0.077139  -7.892 4.78e-14 ***
## unit_idSheridan-Kalorama hd             0.827246   0.076962  10.749  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.079001   0.087517  -0.903 0.367370    
## unit_idSixteenth St hd                  0.530019   0.066663   7.951 3.22e-14 ***
## unit_idSixteenth St near               -0.460736   0.079133  -5.822 1.41e-08 ***
## unit_idStrivers' Section hd             0.470531   0.077781   6.049 4.06e-09 ***
## unit_idStrivers' Section near          -0.505447   0.088248  -5.728 2.35e-08 ***
## unit_idTakoma Park hd                   0.299368   0.100672   2.974 0.003166 ** 
## unit_idTakoma Park near                -0.648551   0.108995  -5.950 7.02e-09 ***
## unit_idWashington Heights hd            0.608060   0.077070   7.890 4.85e-14 ***
## unit_idWashington Heights near         -0.449692   0.086860  -5.177 3.99e-07 ***
## unit_idWoodley Park hd                  0.821304   0.082290   9.981  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.050248   0.021816  -2.303 0.021907 *  
## year1980                               -0.060733   0.025602  -2.372 0.018276 *  
## year1990                               -0.045477   0.028202  -1.613 0.107829    
## year2000                               -0.040522   0.030621  -1.323 0.186670    
## year2010                                0.073224   0.030789   2.378 0.017981 *  
## year2020                                0.060351   0.032538   1.855 0.064545 .  
## treatment_group:desig_yet               0.112820   0.025647   4.399 1.48e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.268 on 320 degrees of freedom
##   (41 observations deleted due to missingness)
## Multiple R-squared:  0.8636, Adjusted R-squared:  0.8342 
## F-statistic: 29.36 on 69 and 320 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##     Estimate   Std. Error      t value     Pr(>|t|) 
## 0.1128198627 0.0256470767 4.3989365386 0.0000148326
## 
## Call:
## did::att_gt(yname = "percent", tname = "year", idname = "unit_id_num", 
##     gname = "first_decade_desig", xformla = ~1, data = comp_df[comp_df$group == 
##         "black" & !is.na(comp_df$n_tot_hd), ], allow_unbalanced_panel = T, 
##     weightsname = "n_tot_hd")
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## Group-Time Average Treatment Effects:
##  Group Time ATT(g,t) Std. Error [95% Simult.  Conf. Band]  
##   1970 1970  -0.0761     0.0398       -0.1739      0.0218  
##   1970 1980  -0.0385     0.0389       -0.1342      0.0572  
##   1970 1990   0.0379     0.0344       -0.0467      0.1225  
##   1970 2000   0.1135     0.0327        0.0331      0.1940 *
##   1970 2010   0.2428     0.0473        0.1265      0.3592 *
##   1970 2020   0.3572     0.0809        0.1582      0.5563 *
##   1980 1970  -0.0589     0.0651       -0.2190      0.1011  
##   1980 1980  -0.1150     0.0825       -0.3179      0.0878  
##   1980 1990  -0.1579     0.0914       -0.3827      0.0669  
##   1980 2000  -0.1230     0.0813       -0.3229      0.0768  
##   1980 2010  -0.0700     0.1028       -0.3230      0.1830  
##   1980 2020  -0.0011     0.1113       -0.2749      0.2727  
##   1990 1970   0.1299     0.1417       -0.2186      0.4784  
##   1990 1980  -0.0431     0.0458       -0.1558      0.0697  
##   1990 1990  -0.0265     0.0498       -0.1491      0.0960  
##   1990 2000  -0.0019     0.0796       -0.1978      0.1940  
##   1990 2010   0.0583     0.0919       -0.1678      0.2844  
##   1990 2020   0.1548     0.1130       -0.1232      0.4328  
##   2000 1970  -0.0856     0.1154       -0.3694      0.1982  
##   2000 1980  -0.0736     0.0213       -0.1260     -0.0211 *
##   2000 1990  -0.1119     0.0442       -0.2206     -0.0031 *
##   2000 2000  -0.0573     0.0364       -0.1469      0.0323  
##   2000 2010  -0.1040     0.0665       -0.2676      0.0597  
##   2000 2020  -0.0429     0.0902       -0.2648      0.1790  
##   2010 1970       NA         NA            NA          NA  
##   2010 1980  -0.1410     0.0409       -0.2417     -0.0404 *
##   2010 1990  -0.0660     0.0469       -0.1815      0.0495  
##   2010 2000  -0.0038     0.0269       -0.0701      0.0625  
##   2010 2010   0.0942     0.0338        0.0110      0.1773 *
##   2010 2020   0.1894     0.0736        0.0083      0.3705 *
##   2020 1970  -0.2271     0.1287       -0.5438      0.0896  
##   2020 1980   0.0217     0.0385       -0.0730      0.1163  
##   2020 1990  -0.0254     0.0457       -0.1379      0.0871  
##   2020 2000   0.0391     0.0705       -0.1343      0.2125  
##   2020 2010  -0.0971     0.0767       -0.2857      0.0915  
##   2020 2020  -0.0448     0.0700       -0.2171      0.1274  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## P-value for pre-test of parallel trends assumption:  0
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
## 
## Call:
## aggte(MP = hd.attgt, type = "group", na.rm = T)
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## 
## Overall summary of ATT's based on group/cohort aggregation:  
##      ATT    Std. Error     [ 95%  Conf. Int.] 
##  -0.0312        0.0467    -0.1227      0.0603 
## 
## 
## Group Effects:
##  Group Estimate Std. Error [95% Simult.  Conf. Band]  
##   1970   0.1062     0.0399        0.0165      0.1959 *
##   1980  -0.0934     0.0860       -0.2868      0.1000  
##   1990   0.0462     0.0730       -0.1180      0.2103  
##   2000  -0.0681     0.0642       -0.2124      0.0763  
##   2010   0.1418     0.0529        0.0229      0.2607 *
##   2020  -0.0448     0.0715       -0.2056      0.1160  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
run_all(mp=.4, buff_dist=.005, threshold=.1)
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.46615 -0.08862 -0.01219  0.08973  0.38973 
## 
## Coefficients: (1 not defined because of singularities)
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.11971    0.05895   2.031  0.04308 *  
## treatment_group                         0.91451    0.08338  10.968  < 2e-16 ***
## desig_yet                              -0.04166    0.03081  -1.352  0.17726    
## unit_idAnacostia near                   0.81417    0.07752  10.502  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.48199    0.08384  -5.749 2.02e-08 ***
## unit_idBlagden Alley/Naylor Court near  0.57859    0.07702   7.512 5.35e-13 ***
## unit_idBloomingdale hd                 -0.18962    0.08269  -2.293  0.02246 *  
## unit_idBloomingdale near                0.72184    0.07752   9.311  < 2e-16 ***
## unit_idCapitol Hill hd                 -0.57203    0.08030  -7.124 6.47e-12 ***
## unit_idCapitol Hill near                0.63494    0.07752   8.190 5.55e-15 ***
## unit_idCleveland Park hd               -0.89396    0.08054 -11.100  < 2e-16 ***
## unit_idCleveland Park near             -0.01964    0.07715  -0.255  0.79919    
## unit_idDowntown hd                     -0.78043    0.08463  -9.221  < 2e-16 ***
## unit_idDowntown near                    0.51352    0.07715   6.656 1.15e-10 ***
## unit_idDupont Circle hd                -0.77888    0.08030  -9.700  < 2e-16 ***
## unit_idDupont Circle near               0.06847    0.07752   0.883  0.37777    
## unit_idFinancial hd                    -0.83926    0.08756  -9.585  < 2e-16 ***
## unit_idFinancial near                   0.33219    0.08042   4.131 4.57e-05 ***
## unit_idFoggy Bottom hd                 -0.90096    0.08336 -10.809  < 2e-16 ***
## unit_idFoggy Bottom near                0.01450    0.07715   0.188  0.85102    
## unit_idFoxhall hd                      -0.96132    0.08463 -11.359  < 2e-16 ***
## unit_idFoxhall near                    -0.04847    0.07715  -0.628  0.53023    
## unit_idGeorgetown hd                   -0.88314    0.08031 -10.997  < 2e-16 ***
## unit_idGeorgetown near                 -0.02042    0.07815  -0.261  0.79404    
## unit_idGreater 14th St hd              -0.56499    0.08102  -6.974 1.65e-11 ***
## unit_idGreater 14th St near             0.43913    0.08026   5.472 8.75e-08 ***
## unit_idGreater U St hd                 -0.33922    0.08102  -4.187 3.62e-05 ***
## unit_idGreater U St near                0.63389    0.07702   8.230 4.22e-15 ***
## unit_idGWU / Old West End hd           -0.93223    0.08573 -10.874  < 2e-16 ***
## unit_idGWU / Old West End near         -0.01203    0.07752  -0.155  0.87679    
## unit_idKalorama Triangle hd            -0.87504    0.08336 -10.498  < 2e-16 ***
## unit_idKalorama Triangle near           0.18830    0.07715   2.441  0.01518 *  
## unit_idKingman Park hd                 -0.06640    0.08573  -0.774  0.43920    
## unit_idKingman Park near                0.82153    0.07752  10.597  < 2e-16 ***
## unit_idLafayette Square hd             -0.93344    0.09318 -10.017  < 2e-16 ***
## unit_idLafayette Square near            0.09096    0.07752   1.173  0.24153    
## unit_idLeDroit Park hd                 -0.13498    0.08320  -1.622  0.10565    
## unit_idLeDroit Park near                0.75719    0.07752   9.767  < 2e-16 ***
## unit_idLogan Circle hd                 -0.47395    0.08320  -5.697 2.67e-08 ***
## unit_idLogan Circle near                0.48365    0.08091   5.978 5.79e-09 ***
## unit_idMassachusetts Ave hd            -0.82760    0.08320  -9.948  < 2e-16 ***
## unit_idMassachusetts Ave near           0.01136    0.07752   0.147  0.88360    
## unit_idMeridian Hill hd                -0.55573    0.08573  -6.482 3.24e-10 ***
## unit_idMeridian Hill near               0.45271    0.07752   5.839 1.24e-08 ***
## unit_idMt. Pleasant hd                 -0.62975    0.08054  -7.819 6.97e-14 ***
## unit_idMt. Pleasant near                0.42770    0.07715   5.544 6.01e-08 ***
## unit_idMt. Vernon Square hd            -0.34309    0.08384  -4.092 5.35e-05 ***
## unit_idMt. Vernon Square near           0.69213    0.07702   8.986  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd         -0.54287    0.08384  -6.475 3.37e-10 ***
## unit_idPennsylvania Ave NHS near        0.48042    0.07702   6.237 1.34e-09 ***
## unit_idShaw hd                         -0.46807    0.08384  -5.583 4.89e-08 ***
## unit_idShaw near                        0.57785    0.07702   7.502 5.69e-13 ***
## unit_idSheridan-Kalorama hd            -0.90788    0.08054 -11.273  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.00208    0.07715   0.027  0.97851    
## unit_idSixteenth St hd                 -0.67598    0.08320  -8.125 8.70e-15 ***
## unit_idSixteenth St near                0.49291    0.07752   6.358 6.69e-10 ***
## unit_idStrivers' Section hd            -0.60929    0.08336  -7.309 1.98e-12 ***
## unit_idStrivers' Section near           0.45826    0.08042   5.698 2.65e-08 ***
## unit_idTakoma Park hd                  -0.38239    0.08336  -4.588 6.35e-06 ***
## unit_idTakoma Park near                 0.56551    0.07715   7.330 1.74e-12 ***
## unit_idWashington Heights hd           -0.69297    0.08463  -8.188 5.64e-15 ***
## unit_idWashington Heights near          0.21280    0.07715   2.758  0.00613 ** 
## unit_idWoodley Park hd                 -0.90962    0.08384 -10.850  < 2e-16 ***
## unit_idWoodley Park near                     NA         NA      NA       NA    
## year1970                                0.06559    0.03118   2.104  0.03612 *  
## year1980                                0.06557    0.03212   2.041  0.04202 *  
## year1990                                0.03289    0.03442   0.955  0.34005    
## year2000                               -0.02511    0.03746  -0.670  0.50317    
## year2010                               -0.12802    0.03893  -3.289  0.00111 ** 
## year2020                               -0.17378    0.04095  -4.243 2.86e-05 ***
## treatment_group:desig_yet              -0.06478    0.03212  -2.017  0.04451 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1441 on 335 degrees of freedom
##   (23 observations deleted due to missingness)
## Multiple R-squared:  0.8474, Adjusted R-squared:  0.816 
## F-statistic: 26.97 on 69 and 335 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## -0.06478398  0.03212131 -2.01685336  0.04450825 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -40.160  -4.324  -0.491   4.167  22.775 
## 
## Coefficients: (1 not defined because of singularities)
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.15260    0.07264   2.101 0.036448 *  
## treatment_group                         0.86609    0.08982   9.643  < 2e-16 ***
## desig_yet                              -0.06611    0.02768  -2.389 0.017506 *  
## unit_idAnacostia near                   0.84440    0.08821   9.572  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.42055    0.14926  -2.818 0.005147 ** 
## unit_idBlagden Alley/Naylor Court near  0.51706    0.15474   3.342 0.000934 ***
## unit_idBloomingdale hd                 -0.15604    0.06909  -2.259 0.024601 *  
## unit_idBloomingdale near                0.68505    0.07953   8.614 3.53e-16 ***
## unit_idCapitol Hill hd                 -0.51922    0.05842  -8.889  < 2e-16 ***
## unit_idCapitol Hill near                0.62190    0.07202   8.635 3.05e-16 ***
## unit_idCleveland Park hd               -0.85293    0.07112 -11.993  < 2e-16 ***
## unit_idCleveland Park near             -0.03331    0.08231  -0.405 0.685994    
## unit_idDowntown hd                     -0.70322    0.12746  -5.517 7.22e-08 ***
## unit_idDowntown near                    0.46925    0.13355   3.514 0.000507 ***
## unit_idDupont Circle hd                -0.72797    0.06222 -11.700  < 2e-16 ***
## unit_idDupont Circle near               0.06021    0.07519   0.801 0.423870    
## unit_idFinancial hd                    -0.49217    0.30756  -1.600 0.110549    
## unit_idFinancial near                   0.30299    0.31037   0.976 0.329707    
## unit_idFoggy Bottom hd                 -0.88750    0.11654  -7.615 3.14e-13 ***
## unit_idFoggy Bottom near               -0.02783    0.12369  -0.225 0.822086    
## unit_idFoxhall hd                      -0.92237    0.13822  -6.673 1.14e-10 ***
## unit_idFoxhall near                    -0.05134    0.14379  -0.357 0.721286    
## unit_idGeorgetown hd                   -0.81990    0.06168 -13.293  < 2e-16 ***
## unit_idGeorgetown near                 -0.01698    0.07510  -0.226 0.821297    
## unit_idGreater 14th St hd              -0.52562    0.06657  -7.896 4.92e-14 ***
## unit_idGreater 14th St near             0.41612    0.07922   5.253 2.77e-07 ***
## unit_idGreater U St hd                 -0.28634    0.06545  -4.375 1.66e-05 ***
## unit_idGreater U St near                0.62359    0.07709   8.089 1.34e-14 ***
## unit_idGWU / Old West End hd           -0.81495    0.09327  -8.738  < 2e-16 ***
## unit_idGWU / Old West End near          0.02693    0.10106   0.266 0.790080    
## unit_idKalorama Triangle hd            -0.81936    0.07968 -10.283  < 2e-16 ***
## unit_idKalorama Triangle near           0.21448    0.08984   2.387 0.017565 *  
## unit_idKingman Park hd                 -0.04317    0.08342  -0.518 0.605150    
## unit_idKingman Park near                0.80061    0.09202   8.700  < 2e-16 ***
## unit_idLafayette Square hd             -0.82491    1.04984  -0.786 0.432608    
## unit_idLafayette Square near            0.07569    1.05068   0.072 0.942621    
## unit_idLeDroit Park hd                 -0.07380    0.10475  -0.705 0.481595    
## unit_idLeDroit Park near                0.75016    0.11307   6.635 1.43e-10 ***
## unit_idLogan Circle hd                 -0.41809    0.11913  -3.509 0.000515 ***
## unit_idLogan Circle near                0.46986    0.12642   3.717 0.000239 ***
## unit_idMassachusetts Ave hd            -0.75271    0.09522  -7.905 4.62e-14 ***
## unit_idMassachusetts Ave near           0.01082    0.10416   0.104 0.917354    
## unit_idMeridian Hill hd                -0.52547    0.07619  -6.896 2.96e-11 ***
## unit_idMeridian Hill near               0.42887    0.08550   5.016 8.86e-07 ***
## unit_idMt. Pleasant hd                 -0.59591    0.06369  -9.356  < 2e-16 ***
## unit_idMt. Pleasant near                0.41452    0.07596   5.457 9.87e-08 ***
## unit_idMt. Vernon Square hd            -0.30077    0.10463  -2.875 0.004320 ** 
## unit_idMt. Vernon Square near           0.64569    0.11226   5.752 2.10e-08 ***
## unit_idPennsylvania Ave NHS hd         -0.59599    0.12710  -4.689 4.10e-06 ***
## unit_idPennsylvania Ave NHS near        0.41863    0.13372   3.131 0.001909 ** 
## unit_idShaw hd                         -0.43735    0.07465  -5.858 1.18e-08 ***
## unit_idShaw near                        0.51531    0.08510   6.055 4.01e-09 ***
## unit_idSheridan-Kalorama hd            -0.86724    0.08060 -10.760  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.00899    0.09062  -0.099 0.921037    
## unit_idSixteenth St hd                 -0.62243    0.07544  -8.250 4.44e-15 ***
## unit_idSixteenth St near                0.46285    0.08658   5.346 1.74e-07 ***
## unit_idStrivers' Section hd            -0.55495    0.08686  -6.389 6.05e-10 ***
## unit_idStrivers' Section near           0.44762    0.09626   4.650 4.90e-06 ***
## unit_idTakoma Park hd                  -0.33952    0.10310  -3.293 0.001104 ** 
## unit_idTakoma Park near                 0.62936    0.11113   5.663 3.36e-08 ***
## unit_idWashington Heights hd           -0.64332    0.08359  -7.696 1.85e-13 ***
## unit_idWashington Heights near          0.23891    0.09262   2.579 0.010354 *  
## unit_idWoodley Park hd                 -0.86687    0.08822  -9.827  < 2e-16 ***
## unit_idWoodley Park near                     NA         NA      NA       NA    
## year1970                                0.08641    0.02607   3.315 0.001025 ** 
## year1980                                0.06676    0.02941   2.270 0.023901 *  
## year1990                                0.01626    0.03184   0.511 0.609906    
## year2000                               -0.02961    0.03420  -0.866 0.387161    
## year2010                               -0.14548    0.03434  -4.236 3.00e-05 ***
## year2020                               -0.20405    0.03611  -5.650 3.60e-08 ***
## treatment_group:desig_yet              -0.07651    0.02797  -2.736 0.006582 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.255 on 313 degrees of freedom
##   (42 observations deleted due to missingness)
## Multiple R-squared:  0.8863, Adjusted R-squared:  0.8613 
## F-statistic: 35.36 on 69 and 313 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##     Estimate   Std. Error      t value     Pr(>|t|) 
## -0.076513848  0.027969810 -2.735586963  0.006582143 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.40451 -0.08189  0.00615  0.08704  0.43801 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.871618   0.056140  15.526  < 2e-16 ***
## treatment_group                        -0.837915   0.079400 -10.553  < 2e-16 ***
## desig_yet                               0.032911   0.029344   1.122 0.262848    
## unit_idAnacostia near                  -0.736871   0.073827  -9.981  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.313089   0.079838   3.922 0.000107 ***
## unit_idBlagden Alley/Naylor Court near -0.589759   0.073349  -8.040 1.56e-14 ***
## unit_idBloomingdale hd                  0.154698   0.078747   1.965 0.050298 .  
## unit_idBloomingdale near               -0.679985   0.073827  -9.211  < 2e-16 ***
## unit_idCapitol Hill hd                  0.537232   0.076469   7.025 1.20e-11 ***
## unit_idCapitol Hill near               -0.586295   0.073827  -7.941 3.05e-14 ***
## unit_idCleveland Park hd                0.825768   0.076696  10.767  < 2e-16 ***
## unit_idCleveland Park near              0.024019   0.073469   0.327 0.743924    
## unit_idDowntown hd                      0.342950   0.080595   4.255 2.71e-05 ***
## unit_idDowntown near                   -0.554708   0.073469  -7.550 4.16e-13 ***
## unit_idDupont Circle hd                 0.685153   0.076469   8.960  < 2e-16 ***
## unit_idDupont Circle near              -0.092159   0.073827  -1.248 0.212790    
## unit_idFinancial hd                     0.799146   0.083382   9.584  < 2e-16 ***
## unit_idFinancial near                  -0.361186   0.076583  -4.716 3.53e-06 ***
## unit_idFoggy Bottom hd                  0.798475   0.079380  10.059  < 2e-16 ***
## unit_idFoggy Bottom near               -0.033562   0.073469  -0.457 0.648100    
## unit_idFoxhall hd                       0.900016   0.080595  11.167  < 2e-16 ***
## unit_idFoxhall near                     0.055441   0.073469   0.755 0.451012    
## unit_idGeorgetown hd                    0.824070   0.076475  10.776  < 2e-16 ***
## unit_idGeorgetown near                  0.026959   0.074420   0.362 0.717386    
## unit_idGreater 14th St hd               0.477090   0.077155   6.184 1.82e-09 ***
## unit_idGreater 14th St near            -0.447141   0.076428  -5.850 1.17e-08 ***
## unit_idGreater U St hd                  0.260533   0.077155   3.377 0.000820 ***
## unit_idGreater U St near               -0.647733   0.073349  -8.831  < 2e-16 ***
## unit_idGWU / Old West End hd            0.818966   0.081644  10.031  < 2e-16 ***
## unit_idGWU / Old West End near         -0.016102   0.073827  -0.218 0.827479    
## unit_idKalorama Triangle hd             0.807409   0.079380  10.172  < 2e-16 ***
## unit_idKalorama Triangle near          -0.225933   0.073469  -3.075 0.002277 ** 
## unit_idKingman Park hd                  0.061310   0.081644   0.751 0.453213    
## unit_idKingman Park near               -0.760042   0.073827 -10.295  < 2e-16 ***
## unit_idLafayette Square hd              0.855788   0.088738   9.644  < 2e-16 ***
## unit_idLafayette Square near           -0.113687   0.073827  -1.540 0.124524    
## unit_idLeDroit Park hd                  0.098421   0.079226   1.242 0.215005    
## unit_idLeDroit Park near               -0.720120   0.073827  -9.754  < 2e-16 ***
## unit_idLogan Circle hd                  0.408525   0.079226   5.156 4.31e-07 ***
## unit_idLogan Circle near               -0.483684   0.077049  -6.278 1.06e-09 ***
## unit_idMassachusetts Ave hd             0.725177   0.079226   9.153  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.020875   0.073827  -0.283 0.777539    
## unit_idMeridian Hill hd                 0.416826   0.081644   5.105 5.55e-07 ***
## unit_idMeridian Hill near              -0.519081   0.073827  -7.031 1.16e-11 ***
## unit_idMt. Pleasant hd                  0.467100   0.076696   6.090 3.09e-09 ***
## unit_idMt. Pleasant near               -0.494167   0.073469  -6.726 7.54e-11 ***
## unit_idMt. Vernon Square hd             0.255524   0.079838   3.201 0.001503 ** 
## unit_idMt. Vernon Square near          -0.680094   0.073349  -9.272  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd          0.479126   0.079838   6.001 5.08e-09 ***
## unit_idPennsylvania Ave NHS near       -0.521600   0.073349  -7.111 7.00e-12 ***
## unit_idShaw hd                          0.293984   0.079838   3.682 0.000269 ***
## unit_idShaw near                       -0.591869   0.073349  -8.069 1.28e-14 ***
## unit_idSheridan-Kalorama hd             0.829678   0.076696  10.818  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.013175   0.073469  -0.179 0.857793    
## unit_idSixteenth St hd                  0.535375   0.079226   6.758 6.23e-11 ***
## unit_idSixteenth St near               -0.533950   0.073827  -7.232 3.25e-12 ***
## unit_idStrivers' Section hd             0.511734   0.079380   6.447 3.99e-10 ***
## unit_idStrivers' Section near          -0.536401   0.076583  -7.004 1.37e-11 ***
## unit_idTakoma Park hd                   0.317187   0.079380   3.996 7.93e-05 ***
## unit_idTakoma Park near                -0.556962   0.073469  -7.581 3.40e-13 ***
## unit_idWashington Heights hd            0.602427   0.080595   7.475 6.81e-13 ***
## unit_idWashington Heights near         -0.261484   0.073469  -3.559 0.000426 ***
## unit_idWoodley Park hd                  0.820595   0.079838  10.278  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.074281   0.029688  -2.502 0.012822 *  
## year1980                               -0.108167   0.030591  -3.536 0.000464 ***
## year1990                               -0.095462   0.032783  -2.912 0.003832 ** 
## year2000                               -0.087654   0.035676  -2.457 0.014518 *  
## year2010                                0.009061   0.037069   0.244 0.807050    
## year2020                               -0.031890   0.039000  -0.818 0.414116    
## treatment_group:desig_yet               0.069553   0.030589   2.274 0.023611 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1372 on 335 degrees of freedom
##   (23 observations deleted due to missingness)
## Multiple R-squared:  0.8368, Adjusted R-squared:  0.8032 
## F-statistic:  24.9 on 69 and 335 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##   Estimate Std. Error    t value   Pr(>|t|) 
## 0.06955300 0.03058909 2.27378498 0.02361122 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.381  -3.653   0.161   3.819  42.825 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.832513   0.071157  11.700  < 2e-16 ***
## treatment_group                        -0.805110   0.087985  -9.151  < 2e-16 ***
## desig_yet                               0.051900   0.027113   1.914 0.056501 .  
## unit_idAnacostia near                  -0.770194   0.086417  -8.912  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.259813   0.146220   1.777 0.076562 .  
## unit_idBlagden Alley/Naylor Court near -0.532170   0.151584  -3.511 0.000513 ***
## unit_idBloomingdale hd                  0.130047   0.067682   1.921 0.055585 .  
## unit_idBloomingdale near               -0.649537   0.077909  -8.337 2.44e-15 ***
## unit_idCapitol Hill hd                  0.497219   0.057225   8.689  < 2e-16 ***
## unit_idCapitol Hill near               -0.574229   0.070555  -8.139 9.53e-15 ***
## unit_idCleveland Park hd                0.798470   0.069670  11.461  < 2e-16 ***
## unit_idCleveland Park near              0.038355   0.080633   0.476 0.634642    
## unit_idDowntown hd                      0.343642   0.124860   2.752 0.006265 ** 
## unit_idDowntown near                   -0.503927   0.130827  -3.852 0.000142 ***
## unit_idDupont Circle hd                 0.647894   0.060952  10.630  < 2e-16 ***
## unit_idDupont Circle near              -0.083677   0.073663  -1.136 0.256851    
## unit_idFinancial hd                     0.443977   0.301291   1.474 0.141599    
## unit_idFinancial near                  -0.335232   0.304048  -1.103 0.271065    
## unit_idFoggy Bottom hd                  0.801685   0.114171   7.022 1.37e-11 ***
## unit_idFoggy Bottom near                0.011542   0.121165   0.095 0.924172    
## unit_idFoxhall hd                       0.873014   0.135405   6.447 4.30e-10 ***
## unit_idFoxhall near                     0.057615   0.140865   0.409 0.682813    
## unit_idGeorgetown hd                    0.775451   0.060421  12.834  < 2e-16 ***
## unit_idGeorgetown near                  0.025057   0.073572   0.341 0.733650    
## unit_idGreater 14th St hd               0.452306   0.065213   6.936 2.32e-11 ***
## unit_idGreater 14th St near            -0.426038   0.077602  -5.490 8.32e-08 ***
## unit_idGreater U St hd                  0.224405   0.064114   3.500 0.000533 ***
## unit_idGreater U St near               -0.634598   0.075521  -8.403 1.55e-15 ***
## unit_idGWU / Old West End hd            0.726040   0.091368   7.946 3.50e-14 ***
## unit_idGWU / Old West End near         -0.071895   0.099000  -0.726 0.468250    
## unit_idKalorama Triangle hd             0.765320   0.078061   9.804  < 2e-16 ***
## unit_idKalorama Triangle near          -0.254952   0.088012  -2.897 0.004036 ** 
## unit_idKingman Park hd                  0.045709   0.081716   0.559 0.576313    
## unit_idKingman Park near               -0.737489   0.090148  -8.181 7.15e-15 ***
## unit_idLafayette Square hd              0.720551   1.028458   0.701 0.484065    
## unit_idLafayette Square near           -0.117743   1.029278  -0.114 0.908999    
## unit_idLeDroit Park hd                  0.052100   0.102614   0.508 0.611999    
## unit_idLeDroit Park near               -0.705348   0.110763  -6.368 6.82e-10 ***
## unit_idLogan Circle hd                  0.366104   0.116707   3.137 0.001869 ** 
## unit_idLogan Circle near               -0.471344   0.123842  -3.806 0.000170 ***
## unit_idMassachusetts Ave hd             0.663601   0.093279   7.114 7.71e-12 ***
## unit_idMassachusetts Ave near          -0.021606   0.102037  -0.212 0.832440    
## unit_idMeridian Hill hd                 0.401067   0.074643   5.373 1.51e-07 ***
## unit_idMeridian Hill near              -0.505532   0.083758  -6.036 4.47e-09 ***
## unit_idMt. Pleasant hd                  0.447731   0.062393   7.176 5.23e-12 ***
## unit_idMt. Pleasant near               -0.478968   0.074416  -6.436 4.59e-10 ***
## unit_idMt. Vernon Square hd             0.229747   0.102494   2.242 0.025691 *  
## unit_idMt. Vernon Square near          -0.636797   0.109973  -5.791 1.71e-08 ***
## unit_idPennsylvania Ave NHS hd          0.529095   0.124513   4.249 2.83e-05 ***
## unit_idPennsylvania Ave NHS near       -0.454930   0.130995  -3.473 0.000587 ***
## unit_idShaw hd                          0.270139   0.073133   3.694 0.000261 ***
## unit_idShaw near                       -0.533742   0.083367  -6.402 5.59e-10 ***
## unit_idSheridan-Kalorama hd             0.802865   0.078956  10.169  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.001633   0.088772  -0.018 0.985331    
## unit_idSixteenth St hd                  0.496251   0.073906   6.715 8.88e-11 ***
## unit_idSixteenth St near               -0.508487   0.084815  -5.995 5.59e-09 ***
## unit_idStrivers' Section hd             0.471414   0.085094   5.540 6.42e-08 ***
## unit_idStrivers' Section near          -0.522272   0.094298  -5.539 6.47e-08 ***
## unit_idTakoma Park hd                   0.285760   0.100996   2.829 0.004964 ** 
## unit_idTakoma Park near                -0.626471   0.108864  -5.755 2.07e-08 ***
## unit_idWashington Heights hd            0.567501   0.081888   6.930 2.40e-11 ***
## unit_idWashington Heights near         -0.290966   0.090738  -3.207 0.001482 ** 
## unit_idWoodley Park hd                  0.790554   0.086419   9.148  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.090397   0.025537  -3.540 0.000461 ***
## year1980                               -0.097673   0.028815  -3.390 0.000789 ***
## year1990                               -0.072697   0.031193  -2.331 0.020412 *  
## year2000                               -0.074565   0.033501  -2.226 0.026743 *  
## year2010                                0.040827   0.033644   1.214 0.225843    
## year2020                                0.014966   0.035377   0.423 0.672547    
## treatment_group:desig_yet               0.084610   0.027400   3.088 0.002196 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.087 on 313 degrees of freedom
##   (42 observations deleted due to missingness)
## Multiple R-squared:  0.8647, Adjusted R-squared:  0.8349 
## F-statistic:    29 on 69 and 313 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## 0.084610049 0.027400032 3.087954399 0.002195878
## 
## Call:
## did::att_gt(yname = "percent", tname = "year", idname = "unit_id_num", 
##     gname = "first_decade_desig", xformla = ~1, data = comp_df[comp_df$group == 
##         "black" & !is.na(comp_df$n_tot_hd), ], allow_unbalanced_panel = T, 
##     weightsname = "n_tot_hd")
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## Group-Time Average Treatment Effects:
##  Group Time ATT(g,t) Std. Error [95% Simult.  Conf. Band]  
##   1970 1970  -0.1121     0.0652       -0.2811      0.0569  
##   1970 1980  -0.0686     0.0636       -0.2335      0.0963  
##   1970 1990   0.0253     0.0643       -0.1413      0.1920  
##   1970 2000   0.0817     0.0678       -0.0939      0.2573  
##   1970 2010   0.2292     0.0962       -0.0201      0.4785  
##   1970 2020   0.3200     0.1246       -0.0029      0.6429  
##   1980 1970  -0.0827     0.0771       -0.2823      0.1170  
##   1980 1980  -0.1166     0.0774       -0.3170      0.0839  
##   1980 1990  -0.1624     0.0783       -0.3653      0.0405  
##   1980 2000  -0.1499     0.0671       -0.3238      0.0240  
##   1980 2010  -0.0622     0.0936       -0.3047      0.1802  
##   1980 2020  -0.0171     0.1055       -0.2903      0.2561  
##   1990 1970   0.1291     0.1138       -0.1657      0.4238  
##   1990 1980  -0.0354     0.0458       -0.1542      0.0834  
##   1990 1990  -0.0144     0.0434       -0.1269      0.0981  
##   1990 2000  -0.0065     0.0798       -0.2131      0.2001  
##   1990 2010   0.0884     0.0923       -0.1507      0.3274  
##   1990 2020   0.1586     0.1234       -0.1612      0.4784  
##   2000 1970  -0.1058     0.1115       -0.3947      0.1831  
##   2000 1980  -0.0630     0.0249       -0.1275      0.0016  
##   2000 1990  -0.1117     0.0435       -0.2245      0.0011  
##   2000 2000  -0.0766     0.0362       -0.1704      0.0172  
##   2000 2010  -0.1099     0.0726       -0.2979      0.0782  
##   2000 2020  -0.0774     0.0962       -0.3265      0.1717  
##   2010 1970       NA         NA            NA          NA  
##   2010 1980  -0.1804     0.0662       -0.3519     -0.0090 *
##   2010 1990  -0.0595     0.0680       -0.2357      0.1166  
##   2010 2000  -0.0258     0.0291       -0.1011      0.0495  
##   2010 2010   0.1084     0.0569       -0.0389      0.2557  
##   2010 2020   0.1836     0.0894       -0.0479      0.4152  
##   2020 1970  -0.2490     0.1282       -0.5811      0.0830  
##   2020 1980   0.0678     0.0266       -0.0012      0.1367  
##   2020 1990  -0.0462     0.0440       -0.1602      0.0679  
##   2020 2000   0.0193     0.0699       -0.1617      0.2004  
##   2020 2010  -0.0863     0.0996       -0.3444      0.1717  
##   2020 2020  -0.0746     0.0784       -0.2777      0.1285  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## P-value for pre-test of parallel trends assumption:  0
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
## 
## Call:
## aggte(MP = hd.attgt, type = "group", na.rm = T)
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## 
## Overall summary of ATT's based on group/cohort aggregation:  
##     ATT    Std. Error     [ 95%  Conf. Int.] 
##  -0.039          0.05    -0.1369       0.059 
## 
## 
## Group Effects:
##  Group Estimate Std. Error [95% Simult.  Conf. Band] 
##   1970   0.0793     0.0757       -0.0784      0.2369 
##   1980  -0.1017     0.0850       -0.2788      0.0754 
##   1990   0.0565     0.0792       -0.1084      0.2214 
##   2000  -0.0880     0.0652       -0.2237      0.0478 
##   2010   0.1460     0.0729       -0.0058      0.2978 
##   2020  -0.0746     0.0811       -0.2435      0.0944 
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
run_all(mp=.25, buff_dist=.005, threshold=.4)
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.44472 -0.08783 -0.01400  0.09448  0.38055 
## 
## Coefficients: (1 not defined because of singularities)
##                                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.1200071  0.0568736   2.110 0.035579 *  
## treatment_group                         0.9234115  0.0812700  11.362  < 2e-16 ***
## desig_yet                              -0.0370648  0.0298690  -1.241 0.215489    
## unit_idAnacostia near                   0.8195788  0.0756438  10.835  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.4887071  0.0818056  -5.974 5.81e-09 ***
## unit_idBlagden Alley/Naylor Court near  0.5430313  0.0751608   7.225 3.29e-12 ***
## unit_idBloomingdale hd                 -0.1974374  0.0806507  -2.448 0.014865 *  
## unit_idBloomingdale near                0.7298120  0.0756438   9.648  < 2e-16 ***
## unit_idCapitol Hill hd                 -0.5789057  0.0783414  -7.390 1.14e-12 ***
## unit_idCapitol Hill near                0.6249114  0.0756438   8.261 3.20e-15 ***
## unit_idCleveland Park hd               -0.9023718  0.0785700 -11.485  < 2e-16 ***
## unit_idCleveland Park near             -0.0218851  0.0752818  -0.291 0.771450    
## unit_idDowntown hd                     -0.7851275  0.0825773  -9.508  < 2e-16 ***
## unit_idDowntown near                    0.4760044  0.0752818   6.323 8.02e-10 ***
## unit_idDupont Circle hd                -0.7595068  0.0783414  -9.695  < 2e-16 ***
## unit_idDupont Circle near               0.0977527  0.0756438   1.292 0.197134    
## unit_idFinancial hd                    -0.8584847  0.0854397 -10.048  < 2e-16 ***
## unit_idFinancial near                   0.3111894  0.0752818   4.134 4.50e-05 ***
## unit_idFoggy Bottom hd                 -0.9089778  0.0813391 -11.175  < 2e-16 ***
## unit_idFoggy Bottom near                0.0275129  0.0752818   0.365 0.714990    
## unit_idFoxhall hd                      -0.9684798  0.0825773 -11.728  < 2e-16 ***
## unit_idFoxhall near                    -0.0504488  0.0752818  -0.670 0.503225    
## unit_idGeorgetown hd                   -0.8890910  0.0783504 -11.348  < 2e-16 ***
## unit_idGeorgetown near                 -0.0029626  0.0762431  -0.039 0.969027    
## unit_idGreater 14th St hd              -0.5514828  0.0790341  -6.978 1.56e-11 ***
## unit_idGreater 14th St near             0.4469663  0.0751608   5.947 6.75e-09 ***
## unit_idGreater U St hd                 -0.3493929  0.0790341  -4.421 1.32e-05 ***
## unit_idGreater U St near                0.6207895  0.0751608   8.259 3.24e-15 ***
## unit_idGWU / Old West End hd           -0.9433830  0.0836458 -11.278  < 2e-16 ***
## unit_idGWU / Old West End near         -0.0008148  0.0756438  -0.011 0.991413    
## unit_idKalorama Triangle hd            -0.8542241  0.0785700 -10.872  < 2e-16 ***
## unit_idKalorama Triangle near           0.2208640  0.0752818   2.934 0.003574 ** 
## unit_idKingman Park hd                 -0.0738165  0.0836458  -0.882 0.378132    
## unit_idKingman Park near                0.8234975  0.0756438  10.887  < 2e-16 ***
## unit_idLafayette Square hd             -0.9278530  0.0909290 -10.204  < 2e-16 ***
## unit_idLafayette Square near            0.1034128  0.0756438   1.367 0.172491    
## unit_idLeDroit Park hd                 -0.1405587  0.0811830  -1.731 0.084286 .  
## unit_idLeDroit Park near                0.7598872  0.0756438  10.046  < 2e-16 ***
## unit_idLogan Circle hd                 -0.4976314  0.0811830  -6.130 2.43e-09 ***
## unit_idLogan Circle near                0.4787708  0.0756438   6.329 7.73e-10 ***
## unit_idMassachusetts Ave hd            -0.8416312  0.0811830 -10.367  < 2e-16 ***
## unit_idMassachusetts Ave near           0.0102139  0.0756438   0.135 0.892670    
## unit_idMeridian Hill hd                -0.5652869  0.0836458  -6.758 6.04e-11 ***
## unit_idMeridian Hill near               0.4614485  0.0756438   6.100 2.87e-09 ***
## unit_idMt. Pleasant hd                 -0.6326093  0.0785700  -8.052 1.37e-14 ***
## unit_idMt. Pleasant near                0.4356021  0.0752818   5.786 1.63e-08 ***
## unit_idMt. Vernon Square hd            -0.3023793  0.0818056  -3.696 0.000255 ***
## unit_idMt. Vernon Square near           0.6741765  0.0751608   8.970  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd         -0.6046580  0.0790341  -7.651 2.05e-13 ***
## unit_idPennsylvania Ave NHS near        0.4295781  0.0751608   5.715 2.38e-08 ***
## unit_idShaw hd                         -0.4050857  0.0790341  -5.125 4.98e-07 ***
## unit_idShaw near                        0.5682189  0.0751608   7.560 3.74e-13 ***
## unit_idSheridan-Kalorama hd            -0.9145850  0.0785700 -11.640  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.0190191  0.0752818   0.253 0.800699    
## unit_idSixteenth St hd                 -0.6829718  0.0811830  -8.413 1.10e-15 ***
## unit_idSixteenth St near                0.4621270  0.0756438   6.109 2.72e-09 ***
## unit_idStrivers' Section hd            -0.6084386  0.0813391  -7.480 6.31e-13 ***
## unit_idStrivers' Section near           0.4560125  0.0752818   6.057 3.65e-09 ***
## unit_idTakoma Park hd                  -0.3886734  0.0813391  -4.778 2.63e-06 ***
## unit_idTakoma Park near                 0.5635829  0.0752818   7.486 6.07e-13 ***
## unit_idWashington Heights hd           -0.7250973  0.0825773  -8.781  < 2e-16 ***
## unit_idWashington Heights near          0.2640157  0.0752818   3.507 0.000514 ***
## unit_idWoodley Park hd                 -0.9165200  0.0818056 -11.204  < 2e-16 ***
## unit_idWoodley Park near                       NA         NA      NA       NA    
## year1970                                0.0604595  0.0286065   2.113 0.035283 *  
## year1980                                0.0663627  0.0296081   2.241 0.025643 *  
## year1990                                0.0351762  0.0319905   1.100 0.272288    
## year2000                               -0.0248661  0.0350964  -0.709 0.479112    
## year2010                               -0.1304792  0.0365858  -3.566 0.000414 ***
## year2020                               -0.1764731  0.0386399  -4.567 6.91e-06 ***
## treatment_group:desig_yet              -0.0720128  0.0309006  -2.330 0.020363 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1406 on 342 degrees of freedom
##   (22 observations deleted due to missingness)
## Multiple R-squared:  0.8493, Adjusted R-squared:  0.819 
## F-statistic: 27.94 on 69 and 342 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## -0.07201277  0.03090058 -2.33046691  0.02036255 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of black residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -37.732  -4.942  -0.056   4.797  23.644 
## 
## Coefficients: (1 not defined because of singularities)
##                                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.1964662  0.0708603   2.773  0.00589 ** 
## treatment_group                         0.8946714  0.0877102  10.200  < 2e-16 ***
## desig_yet                              -0.0637674  0.0277413  -2.299  0.02217 *  
## unit_idAnacostia near                   0.8593022  0.0862284   9.965  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd   -0.4393164  0.1547878  -2.838  0.00483 ** 
## unit_idBlagden Alley/Naylor Court near  0.5088109  0.1606605   3.167  0.00169 ** 
## unit_idBloomingdale hd                 -0.1875762  0.0682286  -2.749  0.00631 ** 
## unit_idBloomingdale near                0.6928462  0.0798870   8.673  < 2e-16 ***
## unit_idCapitol Hill hd                 -0.5366468  0.0560573  -9.573  < 2e-16 ***
## unit_idCapitol Hill near                0.6103526  0.0714407   8.543 5.39e-16 ***
## unit_idCleveland Park hd               -0.8679847  0.0694010 -12.507  < 2e-16 ***
## unit_idCleveland Park near             -0.0248606  0.0820414  -0.303  0.76207    
## unit_idDowntown hd                     -0.7168728  0.1276307  -5.617 4.23e-08 ***
## unit_idDowntown near                    0.4519751  0.1344649   3.361  0.00087 ***
## unit_idDupont Circle hd                -0.7246018  0.0593713 -12.205  < 2e-16 ***
## unit_idDupont Circle near               0.0987389  0.0740830   1.333  0.18354    
## unit_idFinancial hd                    -0.5291229  0.2947888  -1.795  0.07361 .  
## unit_idFinancial near                   0.3197221  0.2980735   1.073  0.28425    
## unit_idFoggy Bottom hd                 -0.9021194  0.1140772  -7.908 4.29e-14 ***
## unit_idFoggy Bottom near               -0.0144841  0.1221511  -0.119  0.90569    
## unit_idFoxhall hd                      -0.9423448  0.1430177  -6.589 1.82e-10 ***
## unit_idFoxhall near                    -0.0466026  0.1490195  -0.313  0.75469    
## unit_idGeorgetown hd                   -0.8445913  0.0600328 -14.069  < 2e-16 ***
## unit_idGeorgetown near                  0.0006988  0.0751453   0.009  0.99259    
## unit_idGreater 14th St hd              -0.5180861  0.0637476  -8.127 9.71e-15 ***
## unit_idGreater 14th St near             0.4142031  0.0769205   5.385 1.41e-07 ***
## unit_idGreater U St hd                 -0.3232525  0.0638590  -5.062 7.01e-07 ***
## unit_idGreater U St near                0.5996690  0.0769858   7.789 9.47e-14 ***
## unit_idGWU / Old West End hd           -0.8657888  0.0900450  -9.615  < 2e-16 ***
## unit_idGWU / Old West End near          0.0094226  0.0989955   0.095  0.92423    
## unit_idKalorama Triangle hd            -0.8203265  0.0726300 -11.295  < 2e-16 ***
## unit_idKalorama Triangle near           0.1957822  0.0847213   2.311  0.02147 *  
## unit_idKingman Park hd                 -0.0638046  0.0837401  -0.762  0.44666    
## unit_idKingman Park near                0.8074028  0.0932501   8.658 2.39e-16 ***
## unit_idLafayette Square hd             -0.9267489  0.7587970  -1.221  0.22286    
## unit_idLafayette Square near            0.0001014  0.7600516   0.000  0.99989    
## unit_idLeDroit Park hd                 -0.0929887  0.1048183  -0.887  0.37567    
## unit_idLeDroit Park near                0.7539723  0.1140165   6.613 1.58e-10 ***
## unit_idLogan Circle hd                 -0.4580150  0.1104244  -4.148 4.31e-05 ***
## unit_idLogan Circle near                0.4767508  0.1190891   4.003 7.77e-05 ***
## unit_idMassachusetts Ave hd            -0.8165418  0.0845372  -9.659  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.0079650  0.0955760  -0.083  0.93364    
## unit_idMeridian Hill hd                -0.5500698  0.0757113  -7.265 2.86e-12 ***
## unit_idMeridian Hill near               0.4445969  0.0860664   5.166 4.22e-07 ***
## unit_idMt. Pleasant hd                 -0.6177726  0.0617400 -10.006  < 2e-16 ***
## unit_idMt. Pleasant near                0.4205202  0.0756608   5.558 5.76e-08 ***
## unit_idMt. Vernon Square hd            -0.2753008  0.1011364  -2.722  0.00684 ** 
## unit_idMt. Vernon Square near           0.6441158  0.1098585   5.863 1.13e-08 ***
## unit_idPennsylvania Ave NHS hd         -0.6739446  0.1163158  -5.794 1.64e-08 ***
## unit_idPennsylvania Ave NHS near        0.3868069  0.1242573   3.113  0.00202 ** 
## unit_idShaw hd                         -0.3717091  0.0683732  -5.436 1.08e-07 ***
## unit_idShaw near                        0.5487454  0.0808312   6.789 5.50e-11 ***
## unit_idSheridan-Kalorama hd            -0.8983123  0.0806460 -11.139  < 2e-16 ***
## unit_idSheridan-Kalorama near           0.0092697  0.0917060   0.101  0.91955    
## unit_idSixteenth St hd                 -0.6411594  0.0698540  -9.179  < 2e-16 ***
## unit_idSixteenth St near                0.4729432  0.0829202   5.704 2.67e-08 ***
## unit_idStrivers' Section hd            -0.5579271  0.0815035  -6.845 3.90e-11 ***
## unit_idStrivers' Section near           0.4717010  0.0924724   5.101 5.80e-07 ***
## unit_idTakoma Park hd                  -0.3578555  0.1054902  -3.392  0.00078 ***
## unit_idTakoma Park near                 0.6350321  0.1142122   5.560 5.69e-08 ***
## unit_idWashington Heights hd           -0.6908240  0.0807590  -8.554 5.00e-16 ***
## unit_idWashington Heights near          0.2595777  0.0910180   2.852  0.00463 ** 
## unit_idWoodley Park hd                 -0.8982288  0.0862284 -10.417  < 2e-16 ***
## unit_idWoodley Park near                       NA         NA      NA       NA    
## year1970                                0.0316263  0.0228606   1.383  0.16749    
## year1980                                0.0150602  0.0268277   0.561  0.57494    
## year1990                               -0.0313242  0.0295518  -1.060  0.28995    
## year2000                               -0.0793529  0.0320865  -2.473  0.01391 *  
## year2010                               -0.1968638  0.0322623  -6.102 3.02e-09 ***
## year2020                               -0.2549599  0.0340952  -7.478 7.32e-13 ***
## treatment_group:desig_yet              -0.0831475  0.0268747  -3.094  0.00215 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.664 on 320 degrees of freedom
##   (41 observations deleted due to missingness)
## Multiple R-squared:  0.8826, Adjusted R-squared:  0.8573 
## F-statistic: 34.87 on 69 and 320 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##     Estimate   Std. Error      t value     Pr(>|t|) 
## -0.083147543  0.026874653 -3.093902023  0.002149637 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, unweighted"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.38568 -0.08740  0.00630  0.08708  0.43495 
## 
## Coefficients: (1 not defined because of singularities)
##                                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.873619   0.054022  16.171  < 2e-16 ***
## treatment_group                        -0.851132   0.077196 -11.026  < 2e-16 ***
## desig_yet                               0.024621   0.028372   0.868 0.386113    
## unit_idAnacostia near                  -0.742433   0.071851 -10.333  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.319857   0.077704   4.116 4.83e-05 ***
## unit_idBlagden Alley/Naylor Court near -0.561789   0.071393  -7.869 4.75e-14 ***
## unit_idBloomingdale hd                  0.163526   0.076607   2.135 0.033505 *  
## unit_idBloomingdale near               -0.690142   0.071851  -9.605  < 2e-16 ***
## unit_idCapitol Hill hd                  0.543682   0.074414   7.306 1.95e-12 ***
## unit_idCapitol Hill near               -0.576602   0.071851  -8.025 1.64e-14 ***
## unit_idCleveland Park hd                0.832759   0.074631  11.158  < 2e-16 ***
## unit_idCleveland Park near              0.024882   0.071508   0.348 0.728081    
## unit_idDowntown hd                      0.361680   0.078437   4.611 5.67e-06 ***
## unit_idDowntown near                   -0.524511   0.071508  -7.335 1.62e-12 ***
## unit_idDupont Circle hd                 0.665740   0.074414   8.946  < 2e-16 ***
## unit_idDupont Circle near              -0.120777   0.071851  -1.681 0.093690 .  
## unit_idFinancial hd                     0.808553   0.081156   9.963  < 2e-16 ***
## unit_idFinancial near                  -0.339169   0.071508  -4.743 3.10e-06 ***
## unit_idFoggy Bottom hd                  0.803936   0.077261  10.405  < 2e-16 ***
## unit_idFoggy Bottom near               -0.045989   0.071508  -0.643 0.520565    
## unit_idFoxhall hd                       0.907615   0.078437  11.571  < 2e-16 ***
## unit_idFoxhall near                     0.056446   0.071508   0.789 0.430441    
## unit_idGeorgetown hd                    0.829330   0.074422  11.144  < 2e-16 ***
## unit_idGeorgetown near                  0.009969   0.072421   0.138 0.890600    
## unit_idGreater 14th St hd               0.464237   0.075072   6.184 1.78e-09 ***
## unit_idGreater 14th St near            -0.461109   0.071393  -6.459 3.63e-10 ***
## unit_idGreater U St hd                  0.269556   0.075072   3.591 0.000378 ***
## unit_idGreater U St near               -0.638783   0.071393  -8.947  < 2e-16 ***
## unit_idGWU / Old West End hd            0.837983   0.079452  10.547  < 2e-16 ***
## unit_idGWU / Old West End near         -0.029159   0.071851  -0.406 0.685121    
## unit_idKalorama Triangle hd             0.780755   0.074631  10.462  < 2e-16 ***
## unit_idKalorama Triangle near          -0.259455   0.071508  -3.628 0.000329 ***
## unit_idKingman Park hd                  0.069613   0.079452   0.876 0.381557    
## unit_idKingman Park near               -0.764435   0.071851 -10.639  < 2e-16 ***
## unit_idLafayette Square hd              0.850463   0.086370   9.847  < 2e-16 ***
## unit_idLafayette Square near           -0.122219   0.071851  -1.701 0.089852 .  
## unit_idLeDroit Park hd                  0.102746   0.077113   1.332 0.183612    
## unit_idLeDroit Park near               -0.723122   0.071851 -10.064  < 2e-16 ***
## unit_idLogan Circle hd                  0.425396   0.077113   5.517 6.83e-08 ***
## unit_idLogan Circle near               -0.485663   0.071851  -6.759 6.00e-11 ***
## unit_idMassachusetts Ave hd             0.737149   0.077113   9.559  < 2e-16 ***
## unit_idMassachusetts Ave near          -0.017763   0.071851  -0.247 0.804887    
## unit_idMeridian Hill hd                 0.428746   0.079452   5.396 1.27e-07 ***
## unit_idMeridian Hill near              -0.531662   0.071851  -7.399 1.07e-12 ***
## unit_idMt. Pleasant hd                  0.472345   0.074631   6.329 7.74e-10 ***
## unit_idMt. Pleasant near               -0.505153   0.071508  -7.064 9.09e-12 ***
## unit_idMt. Vernon Square hd             0.227937   0.077704   2.933 0.003579 ** 
## unit_idMt. Vernon Square near          -0.665552   0.071393  -9.322  < 2e-16 ***
## unit_idPennsylvania Ave NHS hd          0.505943   0.075072   6.739 6.77e-11 ***
## unit_idPennsylvania Ave NHS near       -0.472537   0.071393  -6.619 1.40e-10 ***
## unit_idShaw hd                          0.260691   0.075072   3.473 0.000582 ***
## unit_idShaw near                       -0.588106   0.071393  -8.238 3.78e-15 ***
## unit_idSheridan-Kalorama hd             0.835654   0.074631  11.197  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.028003   0.071508  -0.392 0.695595    
## unit_idSixteenth St hd                  0.561849   0.077113   7.286 2.22e-12 ***
## unit_idSixteenth St near               -0.508194   0.071851  -7.073 8.61e-12 ***
## unit_idStrivers' Section hd             0.511216   0.077261   6.617 1.42e-10 ***
## unit_idStrivers' Section near          -0.529022   0.071508  -7.398 1.08e-12 ***
## unit_idTakoma Park hd                   0.323124   0.077261   4.182 3.67e-05 ***
## unit_idTakoma Park near                -0.555901   0.071508  -7.774 9.01e-14 ***
## unit_idWashington Heights hd            0.631281   0.078437   8.048 1.40e-14 ***
## unit_idWashington Heights near         -0.315365   0.071508  -4.410 1.39e-05 ***
## unit_idWoodley Park hd                  0.830045   0.077704  10.682  < 2e-16 ***
## unit_idWoodley Park near                      NA         NA      NA       NA    
## year1970                               -0.068313   0.027172  -2.514 0.012393 *  
## year1980                               -0.107858   0.028124  -3.835 0.000149 ***
## year1990                               -0.095892   0.030387  -3.156 0.001743 ** 
## year2000                               -0.089326   0.033337  -2.679 0.007730 ** 
## year2010                                0.011874   0.034752   0.342 0.732793    
## year2020                               -0.027148   0.036703  -0.740 0.460002    
## treatment_group:desig_yet               0.082828   0.029351   2.822 0.005053 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1336 on 342 degrees of freedom
##   (22 observations deleted due to missingness)
## Multiple R-squared:  0.8394, Adjusted R-squared:  0.807 
## F-statistic: 25.91 on 69 and 342 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##    Estimate  Std. Error     t value    Pr(>|t|) 
## 0.082827735 0.029351402 2.821934528 0.005052531 
## [1] "_______________________________________________________"
## [1] "D-in-D regression for the % of white residents, using population weights"
## 
## Call:
## lm(formula = main_formula, data = comp_df_subset, weights = wt)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.723  -4.252   0.000   4.122  41.162 
## 
## Coefficients: (1 not defined because of singularities)
##                                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                             0.7935827  0.0686322  11.563  < 2e-16 ***
## treatment_group                        -0.8332195  0.0849522  -9.808  < 2e-16 ***
## desig_yet                               0.0480711  0.0268690   1.789 0.074546 .  
## unit_idAnacostia near                  -0.7817149  0.0835170  -9.360  < 2e-16 ***
## unit_idBlagden Alley/Naylor Court hd    0.2751953  0.1499206   1.836 0.067344 .  
## unit_idBlagden Alley/Naylor Court near -0.5315560  0.1556088  -3.416 0.000718 ***
## unit_idBloomingdale hd                  0.1583479  0.0660832   2.396 0.017140 *  
## unit_idBloomingdale near               -0.6592467  0.0773750  -8.520 6.35e-16 ***
## unit_idCapitol Hill hd                  0.5073249  0.0542947   9.344  < 2e-16 ***
## unit_idCapitol Hill near               -0.5678855  0.0691943  -8.207 5.61e-15 ***
## unit_idCleveland Park hd                0.8098867  0.0672187  12.049  < 2e-16 ***
## unit_idCleveland Park near              0.0281447  0.0794617   0.354 0.723428    
## unit_idDowntown hd                      0.3705982  0.1236175   2.998 0.002931 ** 
## unit_idDowntown near                   -0.4926011  0.1302368  -3.782 0.000185 ***
## unit_idDupont Circle hd                 0.6432893  0.0575044  11.187  < 2e-16 ***
## unit_idDupont Circle near              -0.1201878  0.0717536  -1.675 0.094910 .  
## unit_idFinancial hd                     0.4495022  0.2855195   1.574 0.116399    
## unit_idFinancial near                  -0.3468364  0.2887009  -1.201 0.230496    
## unit_idFoggy Bottom hd                  0.8130229  0.1104901   7.358 1.58e-12 ***
## unit_idFoggy Bottom near               -0.0026451  0.1183102  -0.022 0.982177    
## unit_idFoxhall hd                       0.8901441  0.1385207   6.426 4.75e-10 ***
## unit_idFoxhall near                     0.0529023  0.1443337   0.367 0.714214    
## unit_idGeorgetown hd                    0.7956789  0.0581451  13.684  < 2e-16 ***
## unit_idGeorgetown near                  0.0070295  0.0727824   0.097 0.923119    
## unit_idGreater 14th St hd               0.4436531  0.0617431   7.185 4.74e-12 ***
## unit_idGreater 14th St near            -0.4276036  0.0745018  -5.740 2.20e-08 ***
## unit_idGreater U St hd                  0.2557787  0.0618511   4.135 4.53e-05 ***
## unit_idGreater U St near               -0.6154164  0.0745651  -8.253 4.08e-15 ***
## unit_idGWU / Old West End hd            0.7756251  0.0872136   8.893  < 2e-16 ***
## unit_idGWU / Old West End near         -0.0527090  0.0958827  -0.550 0.582892    
## unit_idKalorama Triangle hd             0.7565506  0.0703462  10.755  < 2e-16 ***
## unit_idKalorama Triangle near          -0.2296673  0.0820573  -2.799 0.005439 ** 
## unit_idKingman Park hd                  0.0636350  0.0811069   0.785 0.433279    
## unit_idKingman Park near               -0.7460236  0.0903180  -8.260 3.90e-15 ***
## unit_idLafayette Square hd              0.8352556  0.7349376   1.136 0.256598    
## unit_idLafayette Square near           -0.0256579  0.7361527  -0.035 0.972218    
## unit_idLeDroit Park hd                  0.0671719  0.1015224   0.662 0.508674    
## unit_idLeDroit Park near               -0.7090082  0.1104314  -6.420 4.91e-10 ***
## unit_idLogan Circle hd                  0.3960907  0.1069522   3.703 0.000250 ***
## unit_idLogan Circle near               -0.4859012  0.1153445  -4.213 3.29e-05 ***
## unit_idMassachusetts Ave hd             0.7226961  0.0818791   8.826  < 2e-16 ***
## unit_idMassachusetts Ave near           0.0003835  0.0925708   0.004 0.996697    
## unit_idMeridian Hill hd                 0.4241685  0.0733307   5.784 1.73e-08 ***
## unit_idMeridian Hill near              -0.5246098  0.0833601  -6.293 1.02e-09 ***
## unit_idMt. Pleasant hd                  0.4643457  0.0597986   7.765 1.11e-13 ***
## unit_idMt. Pleasant near               -0.4911716  0.0732817  -6.703 9.26e-11 ***
## unit_idMt. Vernon Square hd             0.2130068  0.0979563   2.175 0.030399 *  
## unit_idMt. Vernon Square near          -0.6372128  0.1064041  -5.989 5.68e-09 ***
## unit_idPennsylvania Ave NHS hd          0.5597176  0.1126584   4.968 1.10e-06 ***
## unit_idPennsylvania Ave NHS near       -0.4178394  0.1203501  -3.472 0.000588 ***
## unit_idShaw hd                          0.2399045  0.0662233   3.623 0.000339 ***
## unit_idShaw near                       -0.5677409  0.0782896  -7.252 3.12e-12 ***
## unit_idSheridan-Kalorama hd             0.8290561  0.0781102  10.614  < 2e-16 ***
## unit_idSheridan-Kalorama near          -0.0185220  0.0888224  -0.209 0.834949    
## unit_idSixteenth St hd                  0.5305885  0.0676575   7.842 6.66e-14 ***
## unit_idSixteenth St near               -0.5248904  0.0803129  -6.536 2.50e-10 ***
## unit_idStrivers' Section hd             0.4704983  0.0789408   5.960 6.65e-09 ***
## unit_idStrivers' Section near          -0.5505736  0.0895647  -6.147 2.35e-09 ***
## unit_idTakoma Park hd                   0.3002754  0.1021732   2.939 0.003533 ** 
## unit_idTakoma Park near                -0.6329041  0.1106210  -5.721 2.43e-08 ***
## unit_idWashington Heights hd            0.6075398  0.0782197   7.767 1.10e-13 ***
## unit_idWashington Heights near         -0.3157271  0.0881560  -3.581 0.000395 ***
## unit_idWoodley Park hd                  0.8208985  0.0835170   9.829  < 2e-16 ***
## unit_idWoodley Park near                       NA         NA      NA       NA    
## year1970                               -0.0378615  0.0221418  -1.710 0.088243 .  
## year1980                               -0.0484740  0.0259841  -1.866 0.063023 .  
## year1990                               -0.0278595  0.0286225  -0.973 0.331120    
## year2000                               -0.0308885  0.0310776  -0.994 0.321015    
## year2010                                0.0882939  0.0312478   2.826 0.005016 ** 
## year2020                                0.0633931  0.0330231   1.920 0.055790 .  
## treatment_group:desig_yet               0.0950048  0.0260296   3.650 0.000306 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.391 on 320 degrees of freedom
##   (41 observations deleted due to missingness)
## Multiple R-squared:  0.8621, Adjusted R-squared:  0.8323 
## F-statistic: 28.98 on 69 and 320 DF,  p-value: < 2.2e-16
## 
## [1] "__________"
## [1] "Coef. on treatment variable when we add area fixed effects:"
##     Estimate   Std. Error      t value     Pr(>|t|) 
## 0.0950047573 0.0260296117 3.6498722498 0.0003063058
## 
## Call:
## did::att_gt(yname = "percent", tname = "year", idname = "unit_id_num", 
##     gname = "first_decade_desig", xformla = ~1, data = comp_df[comp_df$group == 
##         "black" & !is.na(comp_df$n_tot_hd), ], allow_unbalanced_panel = T, 
##     weightsname = "n_tot_hd")
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## Group-Time Average Treatment Effects:
##  Group Time ATT(g,t) Std. Error [95% Simult.  Conf. Band]  
##   1970 1970  -0.0713     0.0366       -0.1636      0.0211  
##   1970 1980  -0.0318     0.0389       -0.1299      0.0663  
##   1970 1990   0.0527     0.0354       -0.0366      0.1421  
##   1970 2000   0.1171     0.0303        0.0405      0.1937 *
##   1970 2010   0.2604     0.0485        0.1380      0.3829 *
##   1970 2020   0.3505     0.0782        0.1529      0.5481 *
##   1980 1970  -0.0541     0.0591       -0.2033      0.0950  
##   1980 1980  -0.1131     0.0834       -0.3237      0.0975  
##   1980 1990  -0.1479     0.0942       -0.3858      0.0901  
##   1980 2000  -0.1243     0.0837       -0.3357      0.0871  
##   1980 2010  -0.0572     0.1081       -0.3301      0.2157  
##   1980 2020  -0.0127     0.1119       -0.2952      0.2699  
##   1990 1970   0.1347     0.1385       -0.2150      0.4844  
##   1990 1980  -0.0412     0.0482       -0.1628      0.0805  
##   1990 1990  -0.0184     0.0501       -0.1450      0.1081  
##   1990 2000  -0.0051     0.0771       -0.1998      0.1896  
##   1990 2010   0.0692     0.0989       -0.1806      0.3190  
##   1990 2020   0.1413     0.1228       -0.1688      0.4515  
##   2000 1970  -0.0808     0.1137       -0.3678      0.2062  
##   2000 1980  -0.0717     0.0244       -0.1332     -0.0101 *
##   2000 1990  -0.1038     0.0454       -0.2184      0.0108  
##   2000 2000  -0.0685     0.0346       -0.1559      0.0188  
##   2000 2010  -0.1012     0.0746       -0.2896      0.0872  
##   2000 2020  -0.0645     0.0946       -0.3034      0.1744  
##   2010 1970       NA         NA            NA          NA  
##   2010 1980  -0.1391     0.0409       -0.2423     -0.0359 *
##   2010 1990  -0.0579     0.0559       -0.1991      0.0833  
##   2010 2000  -0.0151     0.0253       -0.0790      0.0488  
##   2010 2010   0.1082     0.0557       -0.0324      0.2488  
##   2010 2020   0.1791     0.0887       -0.0448      0.4031  
##   2020 1970  -0.2223     0.1319       -0.5553      0.1107  
##   2020 1980   0.0236     0.0414       -0.0809      0.1281  
##   2020 1990  -0.0173     0.0479       -0.1383      0.1037  
##   2020 2000   0.0279     0.0726       -0.1555      0.2112  
##   2020 2010  -0.0831     0.0825       -0.2914      0.1253  
##   2020 2020  -0.0692     0.0735       -0.2547      0.1164  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## P-value for pre-test of parallel trends assumption:  0
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL
## 
## Call:
## aggte(MP = hd.attgt, type = "group", na.rm = T)
## 
## Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
## 
## 
## Overall summary of ATT's based on group/cohort aggregation:  
##      ATT    Std. Error     [ 95%  Conf. Int.] 
##  -0.0342        0.0493    -0.1309      0.0625 
## 
## 
## Group Effects:
##  Group Estimate Std. Error [95% Simult.  Conf. Band]  
##   1970   0.1130     0.0356        0.0382      0.1877 *
##   1980  -0.0910     0.0931       -0.2865      0.1044  
##   1990   0.0468     0.0742       -0.1092      0.2027  
##   2000  -0.0781     0.0672       -0.2192      0.0630  
##   2010   0.1437     0.0694       -0.0022      0.2895  
##   2020  -0.0692     0.0737       -0.2241      0.0858  
## ---
## Signif. codes: `*' confidence band does not cover 0
## 
## Control Group:  Never Treated,  Anticipation Periods:  0
## Estimation Method:  Doubly Robust
## NULL